I’ve got a ListView, an ArrayList. From activity1, I pass some data, e.g a price and a name of a company. This data will be stored in an ArrayList of Hashmaps. When I first passes some data to the second activity which holds the ListView the data will be found in this list, but when I go back to the first activity and pass some information again, the old data will still be in the list. Is there any possible way I can prevent this to happend? For instance, when I return from activity2 to activity1, the ListView will be wiped.
Thanks!
what you need to do:
on the activity which holds the listView – override the onResume() method:
if it’s not good for you to clear the array list, so you can do the following: