Java tutorial
//package com.java2s; //License from project: Apache License import android.view.MotionEvent; import android.view.View; public class Main { public static boolean isMotionOnView(View view, MotionEvent event) { final float x = event.getX(); final float y = event.getY(); if (x < view.getRight() && x > view.getLeft() && y < view.getBottom() && y > view.getTop()) { return true; } return false; } }