Click here to Skip to main content
15,879,535 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am new in android development,i have made a listview activity now i want that if any thing from that listview is clicked should fetch some xml data from the link associated with it.so please help me as soon as possible,its really urgent. thanks
Posted
Comments
[no name] 7-Jul-12 17:35pm    
If it was so urgent to you then maybe you should have taken the time to formulate a decent question.
azhar eqbal 9-Jul-12 4:02am    
sir i didn't get that,please be clear enough! thanks
omid.nazifi 8-Jul-12 0:07am    
@azhar eqbal: Do you want to fetch xml file for create a listview OR you want to fetch it when click on every item of listview?
azhar eqbal 9-Jul-12 2:39am    
sir i want to fetch xml data when any item of list view is clicked.

1 solution

You have to follow the following steps to get your work done

Step-1 You need to parse the xml. see http://xmlpull.org/v1/src/java/samples/MyXmlPullApp.java[^]

Step-2 Create a bean class for Category. means all the category related data will be stored in that bean class

Step-3 Create an arraylist of that bean class

Step-4 Create a list view using that arraylist ( the list view will display only name of categories)

Step-5 Implement on itemclik listener on the list view. get the position. retrieve the data pass to the intent call second activity

Step-6 In the second activity create a listview and display the data whatever is passed by first activity
 
Share this answer
 
Comments
azhar eqbal 9-Jul-12 3:02am    
can you elaborate with the help of example. Please?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900