Search code examples
androidprogressdialog

How to make a ProgressDialog uncanceled in Android


How to make the ProgressDialog uncanceled in android, when loading I don't want to have the ability to abort the ProgressDialog

        SingupBar = new ProgressDialog(this);
        SingupBar.setMessage("Chargement...");
        SingupBar.setIndeterminate(false);

        SingupBar.show();
        .......
        SingupBar.hide();

and is this the best way to use it ?


Solution

  • Use dialog.setCancelable(false);

        SingupBar = new ProgressDialog(this);
        SingupBar.setMessage("Chargement...");
        SingupBar.setIndeterminate(false);
        SingupBar.setCancelable(false);