Reputation: 4981
Is it possible to detect on android what part of an image (right, left) was touched?
Upvotes: 1
Views: 1069
Reputation: 747
Or you put 2 buttons behind your ImageView, then you have the click handler included directly
Upvotes: 0
Reputation: 7161
sure, attaching a touch listener will allow you to handle the MotionEvent, which contains the actual touch position; just do something like if(event.getX() < image.width / 2) { // touch on left } else { // touch on right; }
Upvotes: 2