开发者

Android IllegalStateException: The content of the adapter has changed but ListView did not receive a no

开发者 https://www.devze.com 2023-03-19 02:47 出处:网络
OK will try and keep this short(ish). I have googled this to death and made a load of changes to my Android app but nothing is solving this one. I am no noobie, 20+ years programming.

OK will try and keep this short(ish). I have googled this to death and made a load of changes to my Android app but nothing is solving this one. I am no noobie, 20+ years programming.

Here is my scenario:

Tab Host, 3 tabs 1st tab has a viewflipper, which displays a listview in three distinct lists.

I am updating an ArrayAdapter for each list from an ArrayList, and when I am updating the ArrayList I am calling notifyDataSetChanged.I am also hiding and showing the ListView as a previous suggested fix for this.

BUT... Every now and again I get the dreaded Force Close with

java.lang.IllegalStateException: The content of the adapter has changed but ListView did not receive a notification

I am updating the adapter on the UI thread, in one place. I have added logging all over the place. I am happy to share log开发者_StackOverflow社区s / code, my blood, to solve this one.

I am running out of ideas and my hair is falling out.

Any ideas / suggestions???

If you want to see my app search for PodPlayer in the market. I just want the bloody thing stable.

Thanks hopefully in advance


Better way is to update ArrayAdapter by using `adapter.add()` method.

If you use this method there is no need to explicitly call notifydataSetChanged() method. add() method will do take care of that


the problem could be the tab, happens to me even now and I have no apps with tab....

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号