Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
yilzer
4,601 PointsHow to get icons in Custom ListView and where to store the event when you click on this icons?
Hi guys,
At the moment I set my icons for my row in the Listview in the custom ArrayAdapter with ConvertView like this set up: -USER - SettingsIcon - TrashcanIcon - So when i click on the Settingsicon i want to remove or block my friend. I have the code for that but i really don't know where to place this code. At the moment I retrieve(store) this code in the custom ArrayAdapter with (ConvertView)Onclicklistener, but this works not optimal to me. Should I do this here or is there another way to store this information elsewhere and retrieve this in die customAdapter? In my fragment where i host my customAdapter i use OnlistItemClick but this only works if you tap on a row in the Listview not when you click on an icon. Is there a way to set code about the settings -and trashcan icon in the onListItemClick or elsewhere in my hostFragment for the CustomAdapter?
I really would like to know this, because i've been struggling with this for a week now..
So i hope you've an answer for me!
Thanks in advance man!