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?
views:
191answers:
1
A:
I suppose you want to update your ListView display, after you remove an item, right?
When you remove the item, you have to modify your data adapter, and let the ListView change 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.
Dimitar Dimitrov
2009-09-27 11:58:25
I think my problem is something different from your given link. I have already update my Listview. But after update(refresh) the List display at First item (not the place where you have just delete the item). My List have more than 4000 rows, and I don't want my User scroll down again.
Dennie
2009-09-27 12:56:43