I am doing the following: Custom ListView with an ImageView and a TextView. I would like to perform different actions depending on whether an image or a text element was clicked. Now, there are two approaches I can take to perform event handling:
Approach #1: Attach an OnItemClick Listener to an item in the ListView and perform a suitable action.
Problem: It remains in question as to which element (image or text) was clicked. How would I determine this piece of information and then take the necessary action?
Approach #2: Attach an OnClick Listener to the image and text separately inside each listview item and then perform a suitable action.
Problem: I am highly skeptical about the performance of this approach. Added to that, when a click is performed, the row of the item is not being highlighted which makes it highly non-intuitive. How would I make the row highlight in this case?