I have set a PNG image(image having transparent background) as button background, When I touch the button it shows me X-coordinate and Y-coordinate of the button’s touched posit
Try this
Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.picture); int color=bitmap.getPixel(x_coordinate, y_coordinate);
Use this color in your if statements to do the required operations