Try the Pythagorean theorem and onTouch, a simple and easy way to do this.
public boolean inCircle(MotionEvent e, int radius, int x, int y) { int dx = ex - x; int dy = ey - y; double d = Math.sqrt((dx * dx) + (dy * dy)); if(d < radius) return true; return false; }
x, y is the position of the circle, radius is the radius, e is the TouchEvent that you have.
@Override public boolean onTouch(View arg0, MotionEvent arg1) { if(arg1.getAction() == MotionEvent.ACTION_DOWN){ if(inCircle(arg1, radius, xCircle, yCircle){
Daniel
source share