출처 : http://www.androes.com/122
01-13 16:18:35.675: ERROR/AndroidRuntime(13682): java.lang.IllegalStateException: The content of the adapter has changed but ListView did not receive a notification. Make sure the content of your adapter is not modified from a background thread, but only from the UI thread. [in ListView(2131099659, class android.widget.ListView) with Adapter(class android.widget.HeaderViewListAdapter)]
위와 같은 메세지가 뜨면서 강제 종료되는 경우 아래와 같은 방법을 이용하면 됩니다.
단, ListActivity가 아닌 Activity 사용시에 적용가능한 코드이오니 착오없으시길..^^
01-13 16:18:35.675: ERROR/AndroidRuntime(13682): java.lang.IllegalStateException: The content of the adapter has changed but ListView did not receive a notification. Make sure the content of your adapter is not modified from a background thread, but only from the UI thread. [in ListView(2131099659, class android.widget.ListView) with Adapter(class android.widget.HeaderViewListAdapter)]
위와 같은 메세지가 뜨면서 강제 종료되는 경우 아래와 같은 방법을 이용하면 됩니다.
단, ListActivity가 아닌 Activity 사용시에 적용가능한 코드이오니 착오없으시길..^^
adapter = new NewAdapter(this, R.layout.new_list_custom, Items);
runOnUiThread(new Runnable() {
public void run() {
adapter.notifyDataSetChanged();
}
});
runOnUiThread(new Runnable() {
public void run() {
adapter.notifyDataSetChanged();
}
});
'안드로이드' 카테고리의 다른 글
WiFi Settings에서 WiFi Enable이 되는 과정 분석. (0) | 2011.07.21 |
---|---|
Ring, Notification, Alarm etc. 저장 위치 (0) | 2011.07.14 |
안드로이드 안전모드 진입 (0) | 2011.07.12 |
CalledFromWrongThreadException (0) | 2011.07.05 |
ICU4C 빌드 방법. (0) | 2011.06.22 |