Hi,
I'm using an AsyncTask in my activity. Looks like:
public class MyActivity {
private AsyncTask mTask;
private void doSomethingCool() {
mTask = new AsyncTask(...);
mTask.execute();
}
@Override
protected void onPause() {
super.onPause();
// How do I let the task keep running if just rotating?
if (isFinishing() == false) {
...
}
}
}
So if the user is rotating the device, onPause() will get called, but I don't want to cancel the task just because of that. I know there's a way to tell the system to not actually destroy my activity on rotation, but is that recommended for this problem? Should I instead put the AsyncTask in a static global class that won't be bound to the Activity?
Thanks