AndroidApp icon indicating copy to clipboard operation
AndroidApp copied to clipboard

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

Open tianxiaogu opened this issue 8 years ago • 0 comments

I found a crash during evaluating my automated testing tool. It seems that the GUI cannot be updated asynchronously in another thread. It might be a trivial bug. Stack trace is below.

// CRASH: com.cityzen.cityzen (pid 26902) (elapsed nanos: 12184728523014)
// Short Msg: android.view.ViewRootImpl$CalledFromWrongThreadException
// Long Msg: android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
// Build Label: google/hammerhead/hammerhead:6.0.1/M4B30Z/3437181:user/release-keys
// Build Changelist: 3437181
// Build Time: 1478203422000
// android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
// 	at android.view.ViewRootImpl.checkThread(ViewRootImpl.java:6556)
// 	at android.view.ViewRootImpl.requestLayout(ViewRootImpl.java:907)
// 	at android.view.View.requestLayout(View.java:18728)
// 	at android.view.View.requestLayout(View.java:18728)
// 	at android.view.View.requestLayout(View.java:18728)
// 	at android.view.View.requestLayout(View.java:18728)
// 	at android.view.View.requestLayout(View.java:18728)
// 	at android.view.View.requestLayout(View.java:18728)
// 	at android.widget.RelativeLayout.requestLayout(RelativeLayout.java:360)
// 	at android.view.View.requestLayout(View.java:18728)
// 	at android.widget.RelativeLayout.requestLayout(RelativeLayout.java:360)
// 	at android.view.View.requestLayout(View.java:18728)
// 	at android.widget.RelativeLayout.requestLayout(RelativeLayout.java:360)
// 	at android.view.View.requestLayout(View.java:18728)
// 	at android.support.v7.widget.RecyclerView.requestLayout(RecyclerView.java:3852)
// 	at android.support.v7.widget.RecyclerView$RecyclerViewDataObserver.onChanged(RecyclerView.java:4937)
// 	at android.support.v7.widget.RecyclerView$AdapterDataObservable.notifyChanged(RecyclerView.java:11359)
// 	at android.support.v7.widget.RecyclerView$Adapter.notifyDataSetChanged(RecyclerView.java:6636)
// 	at com.cityzen.cityzen.Adapters.PlaceListAdapter.resetAdapter(PlaceListAdapter.java:71)
// 	at com.cityzen.cityzen.Fragments.SearchFragment$1$1.run(SearchFragment.java:149)
// 	at java.util.Timer$TimerImpl.run(Timer.java:284)
// 

tianxiaogu avatar Oct 30 '17 20:10 tianxiaogu