Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
/*
 DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
 Version 2, December 2004
    
 Copyright (C) 2013-2014 Jon Petraglia <MrQweex@qweex.com>
    
 Everyone is permitted to copy and distribute verbatim or modified
 copies of this license document, and changing it is allowed as long
 as the name is changed.
    
 DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
    
 0. You just DO WHAT THE FUCK YOU WANT TO.
 */

import android.widget.ListView;

import java.lang.reflect.Method;

public class Main {
    public static void scrollToPosition(ListView v, int pos) {
        //v.smoothScrollToPosition(pos);
        try {
            Method m = v.getClass().getMethod("smoothScrollToPosition", new Class[] { int.class });
            m.invoke(v, pos);
        } catch (Exception e) {
        }
    }
}