How can remove adapter from Listview, Android

android, android-adapter, android-listview, listview, simpleadapter

Solution

Just modify the underlying List and inform the adapter about it. Like that:

oslist.clear();
adapter.notifyDataSetChanged();

if you only want to remove one or two:

oslist.remove(index);
adapter.notifyDataSetChanged();

Problem

I use SimpleAdapter with custom row layout for Listview ``` SimpleAdapter adapter = new SimpleAdapter(ListOrder.this, oslist, R.layout.list_v, new String[] { "name","time","status" }, new int[] { R.id.tablename, R.id.timeorder, R.id.status}); list.setAdapter(adapter); ``` After , i reload data of Listview and i want remove old data. I don't know how i can't remove old data before add new data to Listview. I used ``` adapter.remove(adapter.getItem(i)); ``` but have error The method remove(Object) is undefined for the type SimpleAdapter Please help me ! Thank you!

Original source