tags:

views:

41

answers:

1

hi

how to autoscroll a list view in android?I am adding data to the list so i want that when i add it should autoscroll and the last added item should be visible.

A: 

Use the function setSelectionFromTop(int position, int y)

http://developer.android.com/reference/android/widget/ListView.html#setSelectionFromTop%28int,%20int%29

Jelmer
Thanks for your reply.But can you elaborate a bit.how will i get this Y??coordinates(0,0) start from above or below??.Is there any funtion which can tell which cordinates my list occupies
SPB
Just read the documentation: position: Index (starting at 0) of the data item (adapter) to be selected.y: The distance from the top edge of the ListView (plus padding) that the item will be positioned.
Jelmer