Java tutorial
//package com.java2s; // Use of this source code is governed by a BSD-style license that can be import android.os.SystemClock; import android.view.MotionEvent; import android.view.View; public class Main { private static void dragEnd(View view, float x, float y, long downTime) { sendAction(view, MotionEvent.ACTION_UP, downTime, x, y); } private static void sendAction(View view, int action, long downTime, float x, float y) { long eventTime = SystemClock.uptimeMillis(); MotionEvent event = MotionEvent.obtain(downTime, eventTime, action, x, y, 0); view.onTouchEvent(event); } }