How to use notifyDataSetChanged() in thread

前端 未结 5 1868
醉话见心
醉话见心 2020-12-03 05:00

I create a thread to update my data and try to do notifyDataSetChanged at my ListView.

private class ReceiverThread extends Thread {

@Override
         


        
5条回答
  •  情书的邮戳
    2020-12-03 05:16

    You can not touch the views of the UI from other thread. For your problem you can use either AsyncTask, runOnUiThread or handler.

    All The Best

提交回复
热议问题