EventBus 线程相关问题

@Subscribe(threadMode = ThreadMode.MAIN)

public void onEvent(RecommendEvent event) {

EventBus: Could not dispatch event: class to subscribing class class cn.gongsi.modules.main.MainActivity

 

android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.

 

异常提示,只能在主线程更新UI、EventBus使用过程中加上注解就可以了。接收的时候加上注解。

你可能感兴趣的:(EventBus 线程相关问题)