0

in my app i am sending when i click a button it goes on to a url and it returns back an xml file. The xml file is as follows

<search>
     <data>
      <userid>1</userid>
          <name>Jean</name>
          <address>dbvsvksn</address>
          <dob>Mar 3</dob>
      <country>us</country>
     </data>
     <data>
      <userid>2</userid>
          <name>Anne</name>
          <address>dbvsvksn ,</address>
          <dob>Jun 2<dob>
      <country>us</country>
     </data>
     <data>
      <userid>3</userid>
          <name>J</name>
          <address>dbvsvksn ,</address>
          <dob>Dec 6<dob>
      <country>us</country>
     </data>
</search>

From this xml file i am listing out the name's in a list view in an activity. In the list view when a name is clicked it moves over to a new activity where i want to display the correct address, country and dob.

I am able to get the xml file and list out the names in a list view, but i don't know how to display the exact tag related to the name selected , please help me. How to do this....

2 Answers 2

1

You say you can get the xml file and list out the names, so you apparently are parsing the xml. Are you using one of the XML parser classes (DOM or SAX)? If so, presumably you are building some sort of data structure based on the parsing (probably an array, judging from the XML fragment you posted). Use the index of the selected name to index into the array and retrieve the rest of the data you need.

Perhaps if you posted some code showing what you've tried, we can provide more specific help.

Sign up to request clarification or add additional context in comments.

Comments

0

you can use textview. The number of userid's is there same number of textview.One for each userid,name,address,dob & country. Just add these in tablerow & just check which row is clicked just pass all information of that click in intent & you are able to display all info.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.