1

I have an xml file with different tag

<data>
   <name>xyz</name>
   <img> image with source(/res/img.jpg)</img>
   <desc>this is the description</desc>
</data>

I want to load the List of items available in the xml and on click of listitem i want to display name , image and description in a new screen.

Please help somebody .. its urgent..

S A
  • 19
  • 3

3 Answers3

0

There a number of tutorials on the web that describe how to tackle problems you are facing (XML/List on Android). Here are few:

And there are many more on the web...

Bo.
  • 2,547
  • 3
  • 24
  • 36
  • Hi guys i want that on first screen the super tags to be appeared in a list view and onclick of listitem, it shud go to a next screen displaying the description which is a nested tag in xml file – S A May 07 '12 at 13:30
  • See: http://www.softwarepassion.com/android-series-custom-listview-items-and-adapters/ – Bo. May 07 '12 at 13:47
0

Use this code example to parse the XML file first.


Then with the list of the images you will need to get image from resource folder.

To get image from drawable folder using its name use this code


At last use this great tutorial to display the bunch of images in arraylist.


Links are 1. http://www.roseindia.net/tutorial/xml/dom/ParseDOMDocument.html 2. Android, reference things in R.drawable. using variables? 3. http://www.vogella.com/articles/AndroidListView/article.html

Community
  • 1
  • 1
MKJParekh
  • 34,073
  • 11
  • 87
  • 98
0

When manged to read the XML (if not tell me) here is the code i use to read imageNames out of an JSON to fill the ListView on the About activity:

holder.logo.setImageResource(getResources().getIdentifier("about_logo_"+aboutItems.get(position).getID(),"drawable",getActivity().getPackageName()));

or you mean something else like saveing the binary into the xml and read it? then i must say that not what XML is made for!

oxbox
  • 41
  • 6