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

问题:开发中需要用到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)

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


 EventBus.getDefault().register(this);
 

你可能感兴趣的:(报错,android基础)