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

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

    I had the same sittuation , I had many buttongroup insite my item on listview and I was changing some boolean values inside my item like holder.rbVar.setOnclik...

    my problem occured because I was calling a method inside getView(); and was saving an object inside sharepreference, so I had same error above

    How I solved it; I removed my method inside getView() to notifyDataSetInvalidated() and problem gone

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

提交回复
热议问题