Is it possible for me to dynamically switch the adapter of a Gallery?
In the onCreate() of my activity, I did this:
myGallery.setAdapter(adapter1);
And then later on in my code, I did
myGallery.setAdapter(anotherAdapter1);
I tried, that but in the emulator, the myGallery never gets update when I do ‘setAdapter’ again.
How can I force myGallery free up all the items when it was using adapter1 and then makes it repopulate items for anotherAdapter1?
Thank you.
you need to call notifyDataSetChanged() to the adapter
that will refresh your changes to the gallery view.