I\'m creating a custom calendar for an Android app. The way it works now is that it pulls events from an online MySQL database, transfers them into a JSONArray, and inputs t
I went about this a slightly different way:
First I set a field in the AsyncTask class
private boolean taskDone = false;
Then, after the doInBackground code (or in postExecute):
this.taskDone = true;
Finally add a method to the AsyncTask:
public boolean isTaskDone() {
return taskDone;
}
Now you can use isTaskDone as the argument in the while loop:
while (!isTaskDone()) {
// wait for task
}
Just my way of doing it, I'm sure there are many more