Reputation: 393
Hi I am using a Listview
in my application and I created separate xml for the layout of each row of that ListView
. Each row contains two ImageView
and one One TextView
. I want to get which ImageView
is clicked on that row.
Upvotes: 0
Views: 136
Reputation: 592
convertView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
system.out.println("position"+position)
}});
Upvotes: 0
Reputation: 15701
put the tag with each imageView in getView function of the adapter....
imageView.setTag(Postion);
and get in onclick with view that you received......
Upvotes: 1
Reputation: 67286
You can set OnClickListener
in Adapter
class itself inside getView()
and get the Click Listener working for both the images. As, you haven't posted any code it not feasible to guess.
Upvotes: 2