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
if you used List object and passed to the adapter you can remove the value from the List object and than call the notifyDataSetChanged() using adapter object.
for e.g.
List list = new ArrayList();
ArrayAdapter adapter;
adapter = new ArrayAdapter(DeleteManyTask.this,
android.R.layout.simple_list_item_1,
(String[])list.toArray(new String[0]));
listview = (ListView) findViewById(R.id.list);
listview.setAdapter(adapter);
listview.setAdapter(listAdapter);
for remove do this way
list.remove(index); //or
list.clear();
adpater.notifyDataSetChanged();
or without list object remove item from list.
adapter.clear();
adpater.notifyDataSetChanged();