I have a long ListView
that the user can scroll around before returning to the previous screen. When the user opens this ListView
again, I want the
use this below code :
int index,top;
@Override
protected void onPause() {
super.onPause();
index = mList.getFirstVisiblePosition();
View v = challengeList.getChildAt(0);
top = (v == null) ? 0 : (v.getTop() - mList.getPaddingTop());
}
and whenever your refresh your data use this below code :
adapter.notifyDataSetChanged();
mList.setSelectionFromTop(index, top);