// save index and top position
int index = mList.getFirstVisiblePosition();
View v = mList.getChildAt(0);
int top = (v == null) ? 0 : v.getTop();
// ...
// restore
mList.setSelectionFromTop(index, top);
[Android] Maintain ListView Position when Refreshing
* Maintain/Save/Restore scroll position when returning to a ListView
訂閱:
張貼留言
(
Atom
)
沒有留言 :
張貼留言