출처 : 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 사용시에 적용가능한 코드이오니 착오없으시길..^^

        adapter = new NewAdapter(this, R.layout.new_list_custom, Items);
        runOnUiThread(new Runnable() { 
            public void run() { 
                adapter.notifyDataSetChanged(); 
            } 
        });        

+ Recent posts