aspose file tools*
The moose likes Android and the fly likes How do I assign each of my ListView list items an individual icon? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "How do I assign each of my ListView list items an individual icon?" Watch "How do I assign each of my ListView list items an individual icon?" New topic
Author

How do I assign each of my ListView list items an individual icon?

Matt Fuller
Greenhorn

Joined: Oct 24, 2010
Posts: 2
Hi,

I'm very new to Android delelopment and relatively new to Java, searching and reading various tutorials and using different parts of code from around the internet, trying to make sense of it as I go. Forgive me if my explanation isn't too great.

Currently I have a list created with 4 list items, what I'd like to do is assign a different icon to each of these list items, however, I've no idea how to do it, nor do I know what to search for.

Here's the code:

main.xml


row.xml



FirstList.java



I'd appreciate any input you have, including any resources that you may recommend or critique of my code, as a newbie I'd rather not pick up bad habits from the start!

Thanks.
Hardik Trivedi
Ranch Hand

Joined: Jan 30, 2010
Posts: 252
You are using ArrayAdapter. try using Custom Array Adapter.
Google "Custom Array Adapter with ListView" there are lot of example available.

Best of luck
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How do I assign each of my ListView list items an individual icon?
 
Similar Threads
Why error in this code
how can we view the two lists on a single display???
regarding layout
emulator window was out of view and was recentred
how to add multiple frames