I have an AsyncTask
in my program that seems to stop after onPreExecute()
, after the app is run several times. What I mean is, I can use the app and everything works about 10-20 runs, but then it halts. Here is what's going on:
private class MyTask extends AsyncTask<String, Void, Data> {
protected void onPreExecute() {
// show loading dialog
Log.d(TAG, "end onPreExecute");
}
protected Data doInBackground(String... params) {
Log.d(TAG, "start doInBackground");
// do stuff
}
protected void onPostExecute(Data myData) {
// do stuff
}
}
When it stops working, what happens is that the loading dialog just keeps loading forever, and "end onPreExecute"
prints but "start doInBackground"
does not.
Why might that be?