Forums Register Login

how to use spinners with xml file?

+Pie Number of slices to send: Send
I have an app that displays contents of an xml file that is stored on a server. The xml file contains a list of events and these events have categories. I want to be able to select which category I want then only display the events for that category. So I created a new xml with a spinner but I have no idea what I need to change in the code so for example if I select the film category only the film events are displayed. I know i will also need to change the events xml file.

here is some of the xml file:


and here is main java class that displays the xml file from the server:
+Pie Number of slices to send: Send
After the download and XML parsing, a "loadTourPackages" method is called - I think that should be "displayTourPackages", so that the display gets updated, no? You may need to invalidate the layout so that the UI gets updated.
+Pie Number of slices to send: Send
You could use SQLite with a SimpleCursorAdapter or write your own Adapter that will filter by chosen category or, maybe, ask the server for events of that particular category only. Is the question about how to filter events?

You are already using an AsyncTask, there is no need for a Handler. AsyncTask.onPostExecute() can do whatever the Handler must do.
It was the best of times. It was the worst of times. It was a tiny ad.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 977 times.
Similar Threads
Need help for convert xml by xstream
How to update rows in Table layout
Android not reading xml file
Parse CDATA with XMLParser in this specific case for Android
Problem with HashMap
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 01:52:02.