v4 호환성 앱에 one of the examples을 사용하고 있습니다. 그런 일이 왜FragmentRetainInstanceSupport.java의 UI가 변경되었습니다.
01-29 18:55:08.889: W/dalvikvm(14565): threadid=11: thread exiting with uncaught exception (group=0x40a791f8)
01-29 18:55:08.889: E/AndroidRuntime(14565): FATAL EXCEPTION: Thread-1035
01-29 18:55:08.889: E/AndroidRuntime(14565): android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
01-29 18:55:08.889: E/AndroidRuntime(14565): at android.view.ViewRootImpl.checkThread(ViewRootImpl.java:3939)
01-29 18:55:08.889: E/AndroidRuntime(14565): at android.view.ViewRootImpl.requestLayout(ViewRootImpl.java:701)
01-29 18:55:08.889: E/AndroidRuntime(14565): at android.view.View.requestLayout(View.java:12555)
01-29 18:55:08.889: E/AndroidRuntime(14565): at android.view.View.requestLayout(View.java:12555)
01-29 18:55:08.889: E/AndroidRuntime(14565): at android.view.View.requestLayout(View.java:12555)
01-29 18:55:08.889: E/AndroidRuntime(14565): at android.view.View.requestLayout(View.java:12555)
01-29 18:55:08.889: E/AndroidRuntime(14565): at android.view.View.requestLayout(View.java:12555)
01-29 18:55:08.889: E/AndroidRuntime(14565): at android.widget.RelativeLayout.requestLayout(RelativeLayout.java:268)
01-29 18:55:08.889: E/AndroidRuntime(14565): at android.view.View.requestLayout(View.java:12555)
01-29 18:55:08.889: E/AndroidRuntime(14565): at android.widget.TextView.checkForRelayout(TextView.java:6716)
01-29 18:55:08.889: E/AndroidRuntime(14565): at android.widget.TextView.setText(TextView.java:3256)
01-29 18:55:08.889: E/AndroidRuntime(14565): at android.widget.TextView.setText(TextView.java:3110)
01-29 18:55:08.889: E/AndroidRuntime(14565): at android.widget.TextView.setText(TextView.java:3085)
01-29 18:55:08.889: E/AndroidRuntime(14565): at com.mytest.ui.PreActivity$RetainedFragment$1.run(PreActivity.java:111)
:
mPosition++;
max = mProgressBar.getMax();
mProgressBar.setProgress(mPosition);
mStatus.setText(String.valueOf(max)); // here, just to test stuff!
는 다음과 같은 예외와 함께 제공 :
mPosition++;
max = mProgressBar.getMax();
mProgressBar.setProgress(mPosition);
가 나는 TextView.setText()
추가하는 경우 :이 부분에 나타났습니다? 또는 더 나은 방법은 ProgressView
대신 TextView
을 사용하도록 문서 예제를 조정하는 방법입니다.
텍스트보기에는 특별한 것이 없습니다 (따라서 전체 코드 없음). 그것은 진도보기와 함께 선언되고 인스턴스화됩니다 ... – davidcesarino