How to scroll ListView to top or other position

Published by Igor Khrupin on

Hi,
Recently I want to scroll my ListView widget in my application to top.

Below you can download source code of Android project

To do this I made simple call:

int n = 0 // listView desire position.
listView.smoothScrollToPosition(n);

That’s all 🙂 .This code working since Android 8 API or Android 2.2

Download it from github

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.