Java tutorial
//package com.java2s; import android.graphics.Rect; import android.view.View; public class Main { public static boolean inViewInBounds(View view, int x, int y) { Rect outRect = new Rect(); int[] location = new int[2]; view.getDrawingRect(outRect); view.getLocationOnScreen(location); outRect.offset(location[0], location[1]); return outRect.contains(x, y); } }