Java tutorial
//package com.java2s; import android.os.SystemClock; import android.view.MotionEvent; import android.view.View; public class Main { public static void dispatchCancelEvent(View view) { view.dispatchTouchEvent(MotionEvent.obtain(SystemClock.uptimeMillis(), SystemClock.uptimeMillis(), MotionEvent.ACTION_CANCEL, 0, 0, 0)); } }