i currently create an app that needs an custom listview. Everything with my listview is fine, but now i neet to know, how to set an onClickListener to an view, defined in my list_row.xml. i just want the onclicklistener on the whole item, and on this one inner view. I attach a picture to demonstrate my problem, because it is so hard to describe >.<
Picture (dropbox): https://www.dropbox.com/s/72xdxuwz47vl7s5/problem.png
I need a function that is called when clicking into the view [my Problem] indicates. its an ImageView filled with an image.
Here’s something I’ve done before that seems pretty similar to what you want to accomplish.
First, you declare an
onItemClickListenerfor yourListView. This will handle standard list item taps (that is, taps inside a list item but outside the inner view region that you’re concerned about). You can do this in a variety of places in your code, butonCreate()is a common one.Example:
Then, you can just declare whatever
onClickListeners you need for your inner view(s) inside your adapter’sgetView()method to handle click/tap events on your inner view.Example: