解决问题The content of the adapter has changed but ListView did not receive a notification.

出现的问题:
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. Make sure your adapter calls notifyDataSetChanged() when its content changes.
问题重现
情况是这样的:首先:ListView1嵌套ListView2,ListView1传入Adapter的数据里有一个List1,因为数据格式不是我想要的,所以我又在Adapter里new List2,把List1放入一个List2里面,之后把这个新生成的集合设置给ListView2,因为是ListView嵌套ListView,所以我在重新放数据的时候要把每个条目的List清空,所以就出现了这个问题。
解决问题
出现这问题是因为你的数据源变了报这个异常
这里写图片描述

你可能感兴趣的:(问题记录)