1. 不要在后台线程中直接调用adapter

2. 不要在后台线程中修改adapter绑定的数据

如果对adapter或者adapter绑定的数据是在线程中,加上runOnUiThread就可以了

runOnUiThread(new Runnable(){

        public void run(){

                //修改数据

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

              //notify

               adapter.notifyDataSetChanged();

    }

}

 

相关文章:

  • 2021-07-11
  • 2022-12-23
  • 2021-05-28
  • 2022-12-23
  • 2023-02-20
  • 2021-11-02
  • 2022-12-23
  • 2022-03-01
猜你喜欢
  • 2021-05-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-23
  • 2021-06-30
相关资源
相似解决方案