Android examples for User Interface:MotionEvent
compute Distance for MotionEvent
import android.util.MathUtils; import android.view.MotionEvent; public class Main{ public static double computeDistance(MotionEvent first, MotionEvent second, int pointerIndex) { return MathUtils.dist(first.getX(pointerIndex), first.getY(pointerIndex), second.getX(pointerIndex), second.getY(pointerIndex)); }//www . j a va 2 s.c om }