smooth Scroll List View - Android User Interface

Android examples for User Interface:ScrollView

Description

smooth Scroll List View

Demo Code


//package com.java2s;
import android.os.Build;
import android.widget.ListView;

public class Main {

    public static void smoothScrollListView(ListView listView, int position) {
        if (Build.VERSION.SDK_INT > Build.VERSION_CODES.HONEYCOMB) {
            listView.smoothScrollToPositionFromTop(position, 0);
        } else {// ww w  . j  a v  a2  s.  c om
            listView.setSelection(position);
        }
    }
}

Related Tutorials