赞
踩
- java.lang.RuntimeException:Unable to resume activity {com.liyuhuyu.liyu/com.liyuhuyu.liyu.ui.activity.DeviceStateActivity}: org.greenrobot.eventbus.EventBusException: Subscriber class com.liyuhuyu.liyu.ui.activity.DeviceStateActivity and its super classes have no public methods with the @Subscribe annotation
- android.app.ActivityThread.performResumeActivity(ActivityThread.java:3009)
- ......
-
-
- Caused by:
- org.greenrobot.eventbus.EventBusException:Subscriber class com.liyuhuyu.liyu.ui.activity.DeviceStateActivity 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:140)
- com.liyuhuyu.liyu.ui.activity.DeviceStateActivity.onResume(DeviceStateActivity.java:29)
- android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1257)
1,注册接受事件的组件或者类中没有添加接收事件的方法(例如我的finishActivtiy方法)或者接收事件的方法没有加@Subscriber 注解;如果还是没有解决,请看2
- @Subscribe(threadMode = ThreadMode.MAIN)
- public void finishActivity(DeviceStateBean deviceState) {
- finish();
- }
2,查看接收事件的方法中是否设置了参数,参数为引用数据类型;没有设置参数也是会报以上错误的
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。