开发者

SimpleAdapter including a button. Java, Android

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 t开发者_开发知识库he 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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜