EventBus抛异常了,不能在子线程更新UI。
android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
@Subscribe(
threadMode = ThreadMode.MAIN)
public void onEventMainThread(MessageEvent event){
//更新UI
}
改成这样
就不会抛出主线程异常。
主要修改是threadMode=ThreadMode.Main
由群管理(herohd)整理提供。群号:490832714,欢迎加入!!!