How to remove listview all items

naresh picture naresh · Sep 13, 2011 · Viewed 99.4k times · Source

In my app, if you click on a button then i want to remove all the listview items. Here, i am using the base adapter for adding the items to the list view.

How can i remove the listview items dynamically.

Answer

mah picture mah · Sep 13, 2011

Call setListAdapter() again. This time with an empty ArrayList.