Process: com.letv.myapplication, PID:19088
android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
at android.view.ViewRootImpl.checkThread(ViewRootImpl.java:7286)
at android.view.ViewRootImpl.requestLayout(ViewRootImpl.java:1155)
at android.view.View.requestLayout(View.java:21926)
at android.view.View.requestLayout(View.java:21926)
at android.view.View.requestLayout(View.java:21926)
at android.view.View.requestLayout(View.java:21926)
at android.view.View.requestLayout(View.java:21926)
at android.view.View.requestLayout(View.java:21926)
at android.view.View.requestLayout(View.java:21926)
at android.widget.TextView.checkForRelayout(TextView.java:8526)
at android.widget.TextView.setText(TextView.java:5392)
at android.widget.TextView.setText(TextView.java:5248)
at android.widget.TextView.setText(TextView.java:5205)
对于异常的理解是什么,谷歌的大神们认为你的这个操作已经不符合规则了,不能再让你玩这个程序了,强行停止掉。在源码中搜索 Only the original thread that created a view hierarchy can touch its views.在ViewRootImpl.java中存在下面的代码。
该代码出自 framework/base/core/java/android/view/ViewRootImpl.java
voidcheckThread(){if(mThread != Thread.currentThread()){thrownewCalledFromWrongThreadException("Only the original thread that created a view hierarchy can touch its views.");}}
Process: com.letv.myapplication, PID:27917
android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
at android.view.ViewRootImpl.checkThread(ViewRootImpl.java:7286)
at android.view.ViewRootImpl.requestLayout(ViewRootImpl.java:1155)
at android.view.View.requestLayout(View.java:21926)
at android.view.View.requestLayout(View.java:21926)
at android.view.View.requestLayout(View.java:21926)
at android.view.View.requestLayout(View.java:21926)
at android.view.View.requestLayout(View.java:21926)
at android.view.View.requestLayout(View.java:21926)
at android.view.View.requestLayout(View.java:21926)
at android.widget.TextView.checkForRelayout(TextView.java:8526)
at android.widget.TextView.setText(TextView.java:5392)
at android.widget.TextView.setText(TextView.java:5248)
at android.widget.TextView.setText(TextView.java:5205)
崩溃了。。。
@OverridepublicvoidinvalidateChild(View child, Rect dirty){invalidateChildInParent(null, dirty);}@Overridepublic ViewParent invalidateChildInParent(int[] location, Rect dirty){checkThread();......return null;}