How To Show Title Of A Row In A Textview In Main Activity When An Image In The Row Is Clicked
I have a custom adapter with an image in each row.On clicking the image i would like to display the title of the row that the image is part of. I have implemented an interface in m
Solution 1:
This is a long shot, but did you try utilizing the Tag. It goes like this:
1- In your adapter, set the ImageView tag to be the TextView (title) id:
feedImageView.setTag(name.getId());
2- When the imageView is clicked, you get the tag (i.e. the id of the TextView).
feedImageView.getTag();
3- Now, you have the correct reference to your title.
I'm not sure if passing the TextView id will be enough, but I think utilizing the Tag is the way to go. You just need to figure out what you should pass, and where you should pass it. FYI, you could pass the title (as a string) in the tag!
Post a Comment for "How To Show Title Of A Row In A Textview In Main Activity When An Image In The Row Is Clicked"