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

后端 未结 25 2348
执念已碎
执念已碎 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:42

    I had a custom ListAdapter and was calling super.notifyDataSetChanged() at the beginning and not the end of the method

    @Override
    public void notifyDataSetChanged() {
        recalculate();
        super.notifyDataSetChanged();
    }
    

提交回复
热议问题