Created
February 8, 2011 07:35
-
-
Save nickfox/816045 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// put this in your activity | |
@Override | |
protected Dialog onCreateDialog(int id) { | |
if(id == ID_DIALOG_VALIDATE){ | |
ProgressDialog registerDialog = new ProgressDialog(this); | |
registerDialog.setMessage(getString(R.string.alert_registering_phone)); | |
registerDialog.setIndeterminate(true); | |
registerDialog.setCancelable(true); | |
return registerDialog; | |
} | |
return super.onCreateDialog(id); | |
} | |
// and in AsyncTask | |
protected void onPreExecute() { | |
Log.d(TAG2, "Entered onPreExecute()"); | |
activity.showDialog(activity.ID_DIALOG_VALIDATE); | |
} | |
protected void onPostExecute(Void unused) { | |
Log.d(TAG2, "Entered onPostExecute()"); | |
try { | |
activity.dismissDialog(activity.ID_DIALOG_VALIDATE); | |
} catch (IllegalArgumentException e) {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment