Hi all!
I am creating an app that show a Progress dialog in AsyncTask to
inform the user while web information is being fetched. I've read
there are two ways of doing this: Using handlers or creating and
executing an inner class that overrides the AsyncTask class
I am trying to create and executing inner class that overrides the
AsyncTask class, which runs a resource-intensive thread in the
background, to provide progress updates, and reports back when
finished.
On the OnCreate, I have:
protected Dialog onCreateDialog(int id) {
return ProgressDialog.show(ListSituation.this, "", "Loading.
Please wait...", true);
}
throws the following error:
android.util.AndroidRuntimeException: requestFeature() must be called
before adding content
On the other hand, if I do it this way:
protected Dialog onCreateDialog(int id) {
return progressDialog();
}
public Dialog progressDialog(){
Log.d("Tifersons", "****************************Entra a
progressDialog..");
ProgressDialog dialog = new ProgressDialog(this);
dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
dialog.setMessage("Loading...");
dialog.setIndeterminate(true);
dialog.setCancelable(false);
return dialog;
}
No dialog gets shown.
This is being done inside an activity included in a Tab. When I
switch to another Activity in the tab, the progressDialog gets shown.
Thanks for your help,
Best regards,
Juan.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---