I have a pretty nifty MergeAdapter that contains a bunch of custom views and some custom ListAdapters. This MergeAdapter drives a ListActivity that displays content that get's updated every x seconds.
Currently I just create a new MergeAdapter, create and add all of my custom views (and this includes a few ImageViews) - and call setAdapter on the ListView in my activity.
After about 10 minutes of updates I run out of heap space and crash.
Ultimately because a new ImageView is added, and the following exception is thrown:
Caused by: java.lang.OutOfMemoryError: bitmap size exceeds VM budget
With simpler adapters (like ArrayAdapter), I would just update the data set, and call
notifyDataSetChanged()
on the adapter.
Is there a similar/recommended approach for "updating" a MergeAdapter? Or should I be walking the contents of a potentially complex MergeAdapter and updating individual Views?