Android examples for User Interface:MotionEvent
is MotionEvent Timed Out
import android.util.MathUtils; import android.view.MotionEvent; public class Main{ public static boolean isTimedOut(MotionEvent firstUp, MotionEvent secondUp, int timeout) { final long deltaTime = secondUp.getEventTime() - firstUp.getEventTime(); return (deltaTime >= timeout); }//from ww w . j a v a 2 s .co m }