Do this :
@Override
public boolean onTouch(final View view, MotionEvent event) {
final int action = event.getAction();
int x = event.getX() // or getRawX();
int y = event.getY();
switch(action){
case MotionEvent.ACTION_DOWN:
if (x >= xOfYourBitmap && x < (xOfYourBitmap +yourBitmap.getWidth())
&& y >= yOfYourBitmap && y < (yOfYourBitmap + yourBitmap.getHeight())) {
//You've pressed on your bitmap
}
break;
}
}
1
solved How to make bitmap invisible ontouch in android? [closed]