Kantesh
Kantesh

Reputation: 333

Android List adapter issue

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

Upvotes: 2

Views: 6940

Answers (3)

lbedogni
lbedogni

Reputation: 8007

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();

Upvotes: 6

Steve Haley
Steve Haley

Reputation: 55754

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.

Upvotes: 1

Pentium10
Pentium10

Reputation: 208042

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

Upvotes: 0

Related Questions