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.

这问题满常发生的

由于目前常是Thread + Handler 去处理 api 取得后处理listview的关系。

而非使用AyncTask,

返而容易感受到这bug无所不在。

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

这篇文章,有提到很常见的三个ListView问题

而这个问题要注意的就是要把得到之后后所有动作一定要在Handler做。

会常发生这个问题。

常是Thead后,直接process,process在里面再调用其它handler

反而顺序容易搞混

所以变成我Thead里第一个是调用api的getApi(),第二个则是hanlder直接调用,就比较少发生这样的问题。