(Now I ran into related issues with StackOverflow, but unfortunately none of the solutions worked for me, so I had to ask about it separately)
I am new to Android. Problem: I need to have an image that acts like a button. Now I understand that this can be achieved by using the image on a standard button or using something called "ImageButton" (which I believe is highly recommended, although I donβt know why).
Requirements: I need a detailed guide to solve this problem. In particular, I thought that "put-image-on-standard-button" was easier until I ran into two serious problems: I was unable to set the image in the center (thanks drawable-top, bottom, left6, right) and once changed the background color in accordance with the color of the back screen "Activity", the button effect disappeared. Simply put, I need a moderately simple way to make the image act like a button or a button with an image that has all three effects: focused, pressed, and by default. I used ImageButton, but then I did not know how to make custom shapes or 9patch images to give them all the desired effects, I'm pretty happy with the default button provided by android. All I just need is something like a background hover over the image or something like that that tells the user that the image is clicked and an event has been generated!
Can someone please help me with this? I need the user interface to look decent and therefore need the appropriate effects for my image / button. Thanks in Advance :)
This is my image icon: 
I want to have some kind of hover effect around this, which indicates that the image has been pressed just like any normal button.
source share