作者:卢代马OR撸代码 | 来源:互联网 | 2023-10-10 19:20
线程不断检索list,然后通过handle向UI发出信息,更新adapter,然后就频繁地发生没有及时更新adapter的异常。请问怎么解决?异常信息:uncaughtExce
线程不断检索list,然后通过handle向UI发出信息,更新adapter,然后就频繁地发生没有及时更新adapter的异常。
请问怎么解决?
异常信息: uncaughtException(): ex = 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. Make sure your adapter calls notifyDataSetChanged() when its content changes. [in ListView(2131558445, class android.widget.ListView) with Adapter(class com.excelliance.kxqp.platforms.AddGameActivity$ListAdapter)]