views:

576

answers:

3

How to remove item from a list view? how to reload the list after removal?

A: 

Remove from the adapter, and the list will refresh automatically.

Pentium10
+1  A: 

Please, there's no need to write with multiple question marks like that. Removing items from your ListView depends on how you put in the items in the beginning. Edit your question to provide some details on how you did that. Updating your list afterwards can be done with notifyDataSetChanged() called by your ListView adapter.

Steve H
For example, if you use `ArrayAdapter`, you remove items from the adapter by calling `remove()` on the adapter. If you use `CursorAdapter`, you remove items from the adapter by deleting them from the database, then calling `requery()` on the `Cursor`, which updates the adapter. In either case, your change should be reflected in the `ListView` automatically.
CommonsWare
ok,thank you for your response, i got it,but may i kindly know what prob with question marks?because its strange response.
Kantesh
If you write with many question marks like that, it reads as if you're shouting. It's the same as when people write only in capital letters; it looks like they're angry. Anyway. Were you able to solve the problem with these answers? If not, give us some detail on what you've tried by editing your question, and people will give you some more help.
Steve H
oh,fine..thank you for your kind information..
Kantesh
A: 

Here you can find all the informations.

Anyway you can call

mListAdapter.remove(x); // to remove an item

and

mListAdapter.invalidate(); // to refresh the content

or

mListAdapter.notifyDataSetChanged();
LucaB
Thank you for your kind information. i'll try it.
Kantesh