Skip to content

Instantly share code, notes, and snippets.

@arthtilva
Last active June 6, 2016 17:44
Show Gist options
  • Save arthtilva/92cc42062c90d9cda937635b504ee180 to your computer and use it in GitHub Desktop.
Save arthtilva/92cc42062c90d9cda937635b504ee180 to your computer and use it in GitHub Desktop.
static ProgressDialog progressDialog;
public static void showProgress(Activity activity) {
progressDialog = new ProgressDialog(activity);
progressDialog.setIndeterminate(false);
progressDialog.setCancelable(false);
progressDialog.setMessage("Loading...");
progressDialog.show();
}
public static void showProgress(Activity activity, String message) {
progressDialog = new ProgressDialog(activity);
progressDialog.setIndeterminate(false);
progressDialog.setCancelable(false);
progressDialog.setMessage(message);
progressDialog.show();
}
public static void dismissProgress() {
if (progressDialog.isShowing())
progressDialog.dismiss();
else
Log.i("Dialog", "already dismissed");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment