java.lang.IllegalStateException: The content of the adapter has changed but

发现一个有时候会出现的错误:
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. [in ListView(2131165196, class android.widget.ListView) with Adapter(class com.jovision.multiscreen.views.DeviceScanSelectDialog$DeviceAdapter)
需要data.addAll, Adapter .notifyDataSetChanged() 在主线程执行,
data .addAll( data_update ) ;
if
( data_update_size < 20 ){
   
mListView .setPullLoadEnable( false ) ;
} else {
   
mListView .setPullLoadEnable( true ) ;
}
onLoad()
;
mAlertAdapter .notifyDataSetChanged() ;

你可能感兴趣的:(java.lang.IllegalStateException: The content of the adapter has changed but)