Lets say I have an irregular shape in png format.As you know this shape considered in an invisible square or rectangular when I defined a view (its background is sourced from this png) on my xml.On my activity,I write a piece of code which sends an alertdialog when clicked on the view.even if I click a place which has no revelant with the shape (but it is in that invisible area)I get the dialog.I want to get an action when I click ONLY shape.How can I solve ? Thanks…
Share
Basically,
You have to find a way to correctly and efficiently model the surfaces in the PNG file.
Then you can implement
onTouch(MotionEvent event)of your view to handle the motion events and match the coordinates of the touch with your implementation in the first step.