Giter Site home page Giter Site logo

Comments (9)

jiantao88 avatar jiantao88 commented on August 18, 2024

07-02 20:10:28.130 E/CrashReport(26443): android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3521)
07-02 20:10:28.130 E/CrashReport(26443): ......
07-02 20:10:28.130 E/CrashReport(26443): cause by:
07-02 20:10:28.130 E/CrashReport(26443): java.lang.NullPointerException:
07-02 20:10:28.130 E/CrashReport(26443): org.simple.eventbus.SubsciberMethodHunter.removeMethodsFromMap(SubsciberMethodHunter.java:133)
07-02 20:10:28.130 E/CrashReport(26443): org.simple.eventbus.EventBus.unregister(EventBus.java:176)

from androideventbus.

hehonghui avatar hehonghui commented on August 18, 2024

@jiantao88 是最新版本对吗 ?你是在哪个时机注销的?

from androideventbus.

jiantao88 avatar jiantao88 commented on August 18, 2024

是最新的版本,是在onDestory方法里

from androideventbus.

wurensen avatar wurensen commented on August 18, 2024

确实可能会有这个问题,弱引用持有的订阅者,在没有判断不为null的情况下直接比较了

from androideventbus.

hehonghui avatar hehonghui commented on August 18, 2024

@wurensen 已经看到这个问题,周末处理一下。

from androideventbus.

hehonghui avatar hehonghui commented on August 18, 2024

已经处理了,各位可以看看。当引用对象为空时该Subscription也会被移除;不为空时则会跟传递进来的对象进行判等,如果相等也移除。

from androideventbus.

hehonghui avatar hehonghui commented on August 18, 2024

@jiantao88 @wurensen 你们都在产品中用了么 ?

from androideventbus.

andrewlu1 avatar andrewlu1 commented on August 18, 2024

我想知道能否去掉unregister这一步,能否实现自动取消订阅.
因为有很多场景并不存在成对的onCreate/onDestroy这样的操作的.

from androideventbus.

d0ng13 avatar d0ng13 commented on August 18, 2024

@andrewlu1 可以考虑在onResume和onPause时刻去注册和注销

from androideventbus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.