Closed GoogleCodeExporter closed 8 years ago
I think you need to do it through the underlying array adapter. You should not
try to reset the adapter in the async task but rather reuse already existing
array adapter, clear it's content, fill it with data again and then call
"notifyDataSetChanged" on it. It will then in turn call notifyDataSetChanged of
the section list adapter which will refresh in turn the list view which uses
it. This seems to be most straightforward way of doing it.
Original comment by ja...@potiuk.com
on 18 Aug 2012 at 9:45
Thank you for your prompt reply!
You're solution is exactly what I ended up doing. Fortunately the problem ended
up being my own:
My json data is grouped by date, with the dates being used as the section
headers. Since my data is first an array dates with each date having an array
of data for that date, I wrote a sorting and counting method that returns a
single array with all my data. I also defined a property with the total count
of array elements. So although I nulled out the array adapter, I forgot to
reset the counter property that I used to initiate the exampleArray. The
nullPointerExeption I was receiving was caused by the counter growing when i
tried to refresh the list, since I iniated a much larger exampleArray than
there was actual data.
A stupid mistake, all my own, confirming that your code works perfectly.
Again, thank you!
Original comment by ti...@netscape.net
on 18 Aug 2012 at 11:54
Original issue reported on code.google.com by
ti...@netscape.net
on 17 Aug 2012 at 9:55