I am having a receiver that broadcast when a intent service finishes a server call,When receiver is broadcast in onReceive I have updated list view with new data. What I want is to set the position of item to last element in a list before the broadcast. I have tried using setSelection() and smoothScrollToPosition(),but the list is focused to first item every time a list is updated.
Asked
Active
Viewed 772 times
3 Answers
0
Try this code
mAdapter.notifyDataSetChanged();
where mAdapter is your Adapter Object which you used to populate data in ListView.it will only update your ListView without focused to first item.

Pankaj Singh
- 2,241
- 2
- 16
- 16
-
I have used this code. but still every time list view focus to first item – Dory Jan 03 '13 at 13:02
0
Try this code also
listview.requestLayout(); listview.setSelectionFromTop(listview.getLastVisiblePosition()-20,0);
This make Listview selection from bottom side item

Pranita Patil
- 791
- 1
- 9
- 16