AsyncTask onPostExecute not reliable
I have an async task, which has a very simple doInbackground and
onPostExecute. For some reasons, i see the PostExecute method being
called, and at some very rare times, it gets skipped from being called.
This results in unexpected flow in my application. Given that it gets
called most of the times, i know the syntax and parameters are right. I
also dont "cancel" my asynctask any time. So, why does it get skipped?
private class ViewStoppedAsync extends AsyncTask<Void, Void, Void> {
public ViewStoppedAsync() {
}
@Override
protected Void doInBackground(Void... params) {
Log.d(TAG, "ViewStopped - doInBackground");
<<my code>>
return null;
}
@Override
protected void onPostExecute(Void result) {
Log.d(TAG, "ViewStopped - onPostExecute");
super.onPostExecute(result);
<<my code>>
}
}
No comments:
Post a Comment