問題解決:The content of the adapter has changed but ListView did not receive a notification

1. 不要在後臺線程中直接調用adapterspa

2. 不要在後臺線程中修改adapter綁定的數據線程

若是對adapter或者adapter綁定的數據是在線程中,加上runOnUiThread就能夠了後臺

runOnUiThread(new Runnable(){數據

        public void run(){data

                //修改數據new

              datalist.add(......);void

              //notifyab

               adapter.notifyDataSetChanged();

    }

}

相關文章
相關標籤/搜索