I would like to make a ProgressDialog
cancelable by the back button but not by a screen tap. Currently I use setCancelable(true)
.
However, in some newer devices a tap on the screen also cancels the ProgressDialog
. I'd like to disable the screen tap action while the ProgressDialog
is shown.
So how can I make it so that the Dialog is not cancelable? Android seems to be saying that ProgressDialog should not be used anymore, that instead you should “use a ProgressBar in your layout.” developer.android.com/guide/topics/ui/dialogs.html.
ProgressDialog 's look can be replicated by placing a ProgressBar into an AlertDialog . You can still use it, but Android does not want you to use it, that is why it is deprecated.
Use setCanceledOnTouchOutside(false).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With