I know that this question is asked several times, but my situation is slightly different from other questions.
I have a listview, and initially I want to set the scroll position at the bottom of the list.
I tried 2 ways.
1st number
mCommentListView.setSelection(mAdaptor.getCount()-1);
2nd one
mCommentListView.post(new Runnable() {
@Override
public void run() {
mCommentListView.setSelection(mAdaptor.getCount()-1);
}
});
So, my problem is that both codes work correctly with the emulator , but it does not work with the real device.
What did I miss?
source
share