动态改变的ListView数据我有一个Activity_A那里是一个的ListView其数据取决于值说依赖安卓:从其他活动
从这个Activity_B用户进入Activity_B他可以在其中更改依赖项的值
因为此依赖项必须更改ListView中的数据我必须d重新加载ListView,因此我做到了这一点:
if(//dependency is changed){
Intent intent = new Intent(Activity_B.this,Activity_A.class);
startActivity(intent);
}
ListView中填充了新数据。
问题:
当我从这个新加载Activity_A按下设备后退按钮两次,我最终在Activit_A与以前的ListView数据。所以,如果我尝试点击任何项目我得到这个异常
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
如何避免这种情况?
谢谢