Question

first time asking - hope you can help.

I've created a SimpleAdapter, and an ArrayList/HashMap which maps to a Layout containing an ImageView & 2 TextViews. When the SimpleAdapter is assigned to my ListView it all works exactly as expected. My problem is this - I want to add an ImageButton to the Layout used by the SimpleAdapter and cant work out how to do this. I added the ImageButton to the Layout, and I think I have to create a corresponding ImageButton for each HashMap I add to the ArrayList, but its not doing what I thought. How do I hookup an OnClickListener & how do I reference this back to the ListView index of the item the button was clicked for ?

Hope this explanation makes sense, any code examples would be most helpful. Thanks, daveD

Was it helpful?

Solution

I think that the best option would be to use a custom adapter.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top