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 in the use of TimerTask. TimerTask run should post to a handler, something like this:
private Handler mHandler = new Handler();
public class MyTimerTask extends TimerTask {
public void run() {
mHandler.post(
new Runnable() {
public void run() {
new MyAsyncTask().execute("");
}
};
)
}
}
Of course this is getting a bit ugly, so would recommend taking out the anonymous class.