Morgan
Morgan

Reputation: 15

Add a dynamic image in a ListView

So, basically i'm working with a ListView, looking like this for the moment :


(source: xooimage.com)

(As a new user I can't post images..)

I add each element of the list like that :

map = new HashMap<String, String>();
map.put("ing_name", "Mozzarella");
listItem.add(map);
map = new HashMap<String, String>();
map.put("ing_name", "Emmental");
listItem.add(map);

I would like to put a different picture for every element, to end up with something like that (I photoshoped it) :


(source: xooimage.com)

I tried some things, but couldn't find out one working. Does someone know how to do it ?

Thanks. :-)

Upvotes: 1

Views: 162

Answers (1)

R.daneel.olivaw
R.daneel.olivaw

Reputation: 2679

Try using the Simple adapter class. The below link might be helpful.

Simple adapter example

I hope it helps..

Upvotes: 2

Related Questions