I am loading elements in a ListView at runtime and asking user if he wants to load more elements on a button click.What i want to achieve is that the focus should be on the last element of the listview and not on the first element.
If you want to show the list view from the bottom use below thing .
ListView
android:stackFromBottom="true" />
Its working for me.
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 its bottom lv.setStackFromBottom(true);
You can also set these parameters in XML, eg. like this:
ListView
...
android:transcriptMode="alwaysScroll"
android:stackFromBottom="true" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With