In order to get XML data from a server repeatedly, I\'m attempting to use AsyncTask and Timer as per Mark Murphy\'s suggestion.
I get the following error:
The problem is you can't create the Handler object in the thread that doInBackground() runs in. I would implement the onPreExecute() method and put your setup code in there. Try moving these lines into the onPreExecute() method:
URL url = new URL("http://www.example.com/my.xml");
SAXParserFactory spf = SAXParserFactory.newInstance();
SAXParser sp = spf.newSAXParser();
XMLReader xr = sp.getXMLReader();
MyHandler myHandler = new MyHandler();
xr.setContentHandler(myHandler);