Basically what I do:
I invoke the method showDialog(PROGRESS_DIALOG_ID);
which looks like (copy paste from the tutorial:
protected Dialog onCreateDialog(int id) {
switch(id) {
case PROGRESS_DIALOG_ID:
progressDialog = new ProgressDialog(this);
progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
progressDialog.setProgress(0);
progressDialog.setMessage("Loading...");
return progressDialog;
default:
return null;
}
}
In a Handler I do a progressDialog.setMessage("Uploading...");, which
works finde.
Later on the handler calls a
activity.dismissDialog(PROGRESS_DIALOG_ID).
Now a second time I do the same as aboth.
I do showDialog(PROGRESS_DIALOG_ID);
But when the handler does the
progressDialog.setMessage("Uploading..."); I get the following strange
Nullpointer inside the ProgressDialog
E/AndroidRuntime( 496): java.lang.NullPointerException
E/AndroidRuntime( 496): at
android.app.ProgressDialog.setMessage(ProgressDialog.java:294)
I'm on android 2.1
Any ideas what could be the problem?
Thanks
--
You received this message because you are subscribed to the Google
Groups "Android Developers" 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-developers?hl=en