当前位置:   article > 正文

org.greenrobot.eventbus.EventBusException: Subscriber class ...and its super classes have no public_org.greenrobot.eventbus.eventbusexception: and its

org.greenrobot.eventbus.eventbusexception: and its super classes have no pub

问题:开发中需要用到eventbus总线,容易出现一个小问题


android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3760)
 ......
Caused by:
org.greenrobot.eventbus.EventBusException:Subscriber class ...LoginActivity and its super classes have no public methods with the @Subscribe annotation
org.greenrobot.eventbus.SubscriberMethodFinder.findSubscriberMethods(SubscriberMethodFinder.java:67)
org.greenrobot.eventbus.EventBus.register(EventBus.java:136)
com.slife.seawallcheck.base.BaseActivity.onCreate(BaseActivity.java:60)

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9

解决方案:
@Subscriber 接收的类中 没有 EventBus 注册,添加如下即可


 EventBus.getDefault().register(this);
 
  • 1
  • 2
  • 3
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/2023面试高手/article/detail/251260?site
推荐阅读
相关标签
  

闽ICP备14008679号