Process: com.ideal.idealOA, PID: 2577
android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
at android.view.ViewRootImpl.checkThread(ViewRootImpl.java:6855)
at android.view.ViewRootImpl.requestLayout(ViewRootImpl.java:1040)
at android.view.View.requestLayout(View.java:19654)
at android.view.View.requestLayout(View.java:19654)
at android.view.View.requestLayout(View.java:19654)
at android.view.View.requestLayout(View.java:19654)
at android.view.View.requestLayout(View.java:19654)
at android.view.View.requestLayout(View.java:19654)
at android.view.View.requestLayout(View.java:19654)
at android.widget.RelativeLayout.requestLayout(RelativeLayout.java:360)
at android.view.View.requestLayout(View.java:19654)
at android.support.v7.widget.RecyclerView.requestLayout(RecyclerView.java:4090)
at android.support.v7.widget.RecyclerView$RecyclerViewDataObserver.onChanged(RecyclerView.java:5182)
at android.support.v7.widget.RecyclerView$AdapterDataObservable.notifyChanged(RecyclerView.java:11785)
at android.support.v7.widget.RecyclerView$Adapter.notifyDataSetChanged(RecyclerView.java:6961)
at com.idealOA.view.activity.contacts.ContactsActivity.refreshListView(ContactsActivity.java:129)
at com.idealOA.model.mode.presenter.ContactPresenter$1.onSucceed(ContactPresenter.java:66)
at com.idealOA.model.mode.presenter.ContactPresenter$1.onSucceed(ContactPresenter.java:57)
at com.idealOA.net.AppObserver.onNext(AppObserver.java:17)
at io.reactivex.internal.operators.observable.ObservableCreate$CreateEmitter.onNext(ObservableCreate.java:67)
at com.idealOA.net.OkHttpFactory$1$1.onResponse(OkHttpFactory.java:149)
at okhttp3.RealCall$AsyncCall.execute(RealCall.java:153)
at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)
很崩溃的加载了列表recyclerView,一刷新它的数据就包上面的错,然后点击问题位置发现是adapter.notifyDataSetChanged();这里报错了。然后查看代码发现完全没错,查了Only the original thread that created a view hierarchy can touch its views.这个错误,都说用Handle,是线程问题,然后我是先用Thread,发现没用,我也没用Handle,我用了runOnUiThread.我也找不出原因。记录一下这个错误,以后查看