Android, ListView IllegalStateException: “The content of the adapter has changed but ListView did not receive a notification”

后端 未结 25 2349
执念已碎
执念已碎 2020-11-22 16:59

What I want to do: run a background thread which calculates ListView contents and update ListView partially, while results are calculated.

W

25条回答
  •  长发绾君心
    2020-11-22 17:36

    I had the same issue.

    I was adding items to my ArrayList outside the UI thread.

    Solution: I have done both, adding the items and called notifyDataSetChanged() in the UI thread.

提交回复
热议问题