Possible Duplicate:
how to clear my listview in android
In android, i have used a listadapter, simple adapter and passed an array and i want to clear the listview contents? Instead of clearing , it is appending the records to my listview.
Possible Duplicate:
how to clear my listview in android
In android, i have used a listadapter, simple adapter and passed an array and i want to clear the listview contents? Instead of clearing , it is appending the records to my listview.
Use
notifydataSetInValidated()
on your adapter to notify your listview that the data set is not longer valid. or set your addapter to null :l.setAdapter(null);
Simply write listView.setAdapter(null)
Grab my Custom adapter from here. TestAdapter
Now add a method like this..
Now call
youListAdapter.clearAdapter()
from you Activity.