I would like to make sure that the list is scrolled all the way to the bottom, after I have updated the listview by using listAdapter, so that it displays the last element entered in the list. How can I do this ?
I tried this but no luck:
lv.setTranscriptMode(ListView.TRANSCRIPT_MODE_ALWAYS_SCROLL);
thank you
A combination of TRANSCRIPT_MODE_ALWAYS_SCROLL and setSelection made it work for me
Supposing you know when the list data has changed, you can manually tell the list to scroll to the bottom by setting the list selection to the last row. Something like:
You need to use these parameters in your list view:
Scroll
lv.setTranscriptMode(ListView.TRANSCRIPT_MODE_ALWAYS_SCROLL);
Set the head of the list to it bottom
lv.setStackFromBottom(true);
You can also set these parameters in XML, eg. like this: