I have this GetAllUsers(); in onCreate and I have this
private void GetAllUsers() {
(new LoadingUsers(this)).execute();
}
Then I have this
private class LoadingUsers extends AsyncTask < Void, Integer, String > {
String TAG = getClass().getSimpleName();
AlertDialog.Builder builderSingle;
ArrayAdapter < String > arrayAdapter;@
SuppressWarnings("unused")
Context mContext;
public LoadingUsers(Context context) {
super();
mContext = context;
}
protected void onPreExecute() {
// prgDialog.show();
// builderSingle = new
Log.d(TAG + " PreExceute", "On pre Exceute......");
}
protected String doInBackground(Void...arg0) {
Log.d(TAG + " DoINBackGround", "On doInBackground...");
return null;
}
protected void onProgressUpdate(Integer...a) {
super.onProgressUpdate(a);
Log.d(TAG + " onProgressUpdate", "You are in progress update ... " + a[0]);
}
protected void onPostExecute(String result) {
// prgDialog.hide();
Log.d(TAG + " onPostExecute", "" + result);
MainActivity.this.pd.dismiss();
}
}
I wanted to put a builderSingle = new AlertDialog.Builder(MainActivity.this); inside the protected void onProgressUpdate(Integer... a) { which has a AsyncHttpClient client = new AsyncHttpClient(); but unfortunately the onProgressUpdate does not get called at all. I know this because the log does not show. All other log are showing except the onProgressUpdate I have also have
@
Override
protected void onDestroy() {
super.onDestroy();
Log.i(TAG, "On Destroy .....");
}
@
Override
protected void onPause() {
super.onPause();
Log.i(TAG, "On Pause .....");
}
@
Override
protected void onRestart() {
super.onRestart();
Log.i(TAG, "On Restart .....");
}
@
Override
protected void onResume() {
super.onResume();
Log.i(TAG, "On Resume .....");
}
@
Override
protected void onStart() {
super.onStart();
Log.i(TAG, "On Start .....");
}
@
Override
protected void onStop() {
super.onStop();
Log.i(TAG, "On Stop .....");
}
OnStart and OnResume are being log as well.
Why is onProgressUpdate not being called? How to call the onProgressUpdated correctly?
Update
onPostExecute is being called as well on the onProgressUpdate is not