Java tutorial
//package com.java2s; //License from project: Apache License import android.graphics.Rect; import android.view.MotionEvent; import android.view.View; public class Main { public static boolean isMotionFocusOnView(View view, MotionEvent event) { Rect focusBound = new Rect(); view.getFocusedRect(focusBound); return focusBound.contains((int) event.getX(), (int) event.getY()); } }