Android : clear listview in Listadapter
Grab my Custom adapter from here. TestAdapter
Now add a method like this..
public void clearAdapter()
{
deviceNames.clear();
selected.clear();
notifyDataSetChanged();
}
Now call youListAdapter.clearAdapter()
from you Activity.
Simply write listView.setAdapter(null)
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);