大家好,
我使用AsyncTask异步的去服务器取得一个ArrayList
让adapter吃进ArrayList并动态更新ListView里Item的资料.
点击Item时会取得Item Position并再去后台取得详细资讯,
之后用一个Activity呈现这个资讯.
但现在在点击Item时三不五时就会出现下列Exception:
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.
Google之后我有修正更新通知:
private class getDispatchedTask extends AsyncTask<String, Integer, String>{
...
protected void onPostExecute(String result) {
...
adapter.notifyDataSetChanged();
}
}
但问题还是会发生
请教高手协助
谢谢~