I am trying to make it so when you click this "Play" bitmap it will run other code the thing is i don't know how to check for it.
I tried drawing it as
playX = WIDTH / 2;
playY = HEIGHT / 2;
Bitmap playButton = BitmapFactory.decodeResource(getResources(), R.drawable.play_button);
playWidth = playX + playButton.getScaledWidth(canvas);
playHeight = playY + playButton.getScaledHeight(canvas);
Then a touch Event
@Override
public boolean onTouchEvent(MotionEvent event){
if(event.getX() > playX && event.getX() < playWidth){
if(event.getX() > playY && event.getY() < playHeight){
System.out.println("Button Pushed");
}
}}
but it doesn't seem to work i dont know if there is a better way to run code when a bitmap is clicked? (I am only using the java class not xml)