I choose an item to remove from my ListView. And after the Item was removed, my ListView was scrolled back and display at the first Item.
I want my ListView display in right place where the Item I had removed (It like remove a contact in Android Contact list). How can I do that?
I choose an item to remove from my ListView . And after the Item
Share
I suppose you want to update your
ListViewdisplay, after you remove an item, right?When you remove the item, you have to modify your data adapter, and let the
ListViewchange accordingly (something like the MVC pattern behavior). I’ve seen somewhat similar questions (and the corresponding answers 🙂 ) here and here.Edit:
Aha, in that case, try using
setSelection(int), after recalculating new indices and new item count.