Android - 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.

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. 

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. 

這問題滿常發生的

由於目前常是Thread + Handler 去處理 api 取得後處理listview的關係。

而非使用AyncTask,

返而容易感受到這bug無所不在。

http://www.xuebuyuan.com/1124266.html

這篇文章,有提到很常見的三個ListView問題

而這個問題要注意的就是要把得到之後後所有動作一定要在Handler做。

會常發生這個問題。

常是Thead後,直接process,process在裡面再呼叫其它handler

反而順序容易搞混

所以變成我Thead裡第一個是呼叫api的getApi(),第二個則是hanlder直接呼叫,就比較少發生這樣的問題。