Search code examples
androidlistviewadaptergetview

How to go in getView of BaseAdapter to refresh list item? NotifyDataSetChanged not working


When i call notifyDataSetChanged() compiler goes into getCount() but not into getView method.

  • I am not adding the new list item, i have just changed some boolean in my existing list item object which i want to use into the if statement in getView method for doing some item-layout changes, but compiler never goes in getView even if i called notifyDataSetChanged()

  • for debug i tried to print log of that item boolean into getCount(), and that boolean value is changed!

So my question is: Why compiler not goes into getView method when i do some changes in list item? Any solution for this problem?


Solution

  • I have found the solution. Changing the list item and notifyDataSetChanged() method was not called from main thread.