14

I have a list which is filled with a custom ArrayAdapter.

I want to update a progress bar every second, so I am trying to use notifyDataSetChanged() in order to repaint the list but it doesn't seem to work.

midhunhk
  • 5,560
  • 7
  • 52
  • 83
Gerardo
  • 5,800
  • 11
  • 66
  • 94

3 Answers3

14

How are you updating the List data structure that is feeding ArrayAdapter?

Please see my answer here: notifyDataSetChanged example

for issues regarding ArrayAdapters and updating the List that holds data for notifyDataSetChanged to work.

Community
  • 1
  • 1
jnosek
  • 4,223
  • 2
  • 19
  • 20
2

If you are not calling this from the main thread try having the main thread call this function. That is usually the problem when notifyDataSetChanged isn't updating the actual screen contents.

snctln
  • 12,175
  • 6
  • 45
  • 42
0

I probably have the answer. Try this:

((BaseAdapter) arrayAdapter).notifyDataSetChanged();

I had the same problem and this was the solution for mine :)

hardfork
  • 2,470
  • 1
  • 23
  • 43