Android studio AlertDialog ProgressBar lock [duplicate] - android

This question already has answers here:
Prevent Android activity dialog from closing on outside touch
(20 answers)
Closed 6 years ago.
I need to lock my AlertDialog. Now, when my alertDialog is enable and when i click on the screen, my alertdialog closed. I need to wait the end of the progress bar to close my alertDialog. How i can do this? Thank

You just need to use alertdialog.setCancelable(false) so the dialog does not close when the user touches elsewhere on the screen, or touches the back button on their phone. After your progress bar completes, call alertdialog.dismiss() to close it.

Related

alert dialog closing touch any where in the screen with out press yes or no

I am using alert dialog in my android app, which has a YES and a NO button.
I want the alert to close on clicking either YES or NO, but it is closing touch everywhere in the screen how to stop it.
Have you tried Dialog.setCanceledOnTouchOutside(false) ?
http://developer.android.com/reference/android/app/Dialog.html#setCanceledOnTouchOutside(boolean)

Android: AlertDialog - User click somewhere else [duplicate]

This question already has answers here:
How to avoid dismissing my progress dialog when the user touches the screen?
(6 answers)
Closed 8 years ago.
I have an Alert-dialog with 2 buttons( Yes/No )
If user click yes or no the alert dialog behave normal and get into on-click method, but if user click or touch somewhere outside of alert dialog it just disappear, and nothing will happen, Is there any way to prevent dialog from disappearing when user clicked somewhere else???
Prevent dismiss dialog box on outside touch use this
dialog.setCanceledOnTouchOutside(false);
Add this line to your AlertDialog..
alertDialog.setCanceledOnTouchOutside(false);
For more read here Dialog cancel
You must give this line.
alertDialog.setCanceledOnTouchOutside(false);
on bottom of the your AlertDialog.
Yes Use
YourAlertDialog.setCanceledOnTouchOutside(false);
use
alertDialog.setCanceledOnTouchOutside(false);
also you can use given below line for a practice that alert dialog can only go away by pressing the buttons
alertDialog.setCancelable(false).
This will make it so it can only go away by pressing the buttons.
I usually use the combination of:
alertDialog.setCancelable(false);
alertDialog.setCanceledOnTouchOutside(false);

Hiding Home and Back button in Android [duplicate]

This question already has answers here:
Hide ICS back home task switcher buttons
(6 answers)
Closed 9 years ago.
I would like my app to hide the Home and Back button which is show at bottom of activity.
I was able to hide the title bar but I am not able to do for Home and Back button.
Is it possible to do it?
Starting from Android 4.4 KitKat, you can use "immersive" full-screen mode. Here's the detail and some sample codes.
https://developer.android.com/training/system-ui/immersive.html

How to override the onbackpressed event for Dialog box in android? [duplicate]

This question already has answers here:
How to handle Back button with in the dialog?
(9 answers)
Closed 9 years ago.
In android, how can you override the onbackpressed event for Dialog boxes?
Currently if I press back, it will dismiss it...
Thanks.
You can just set
mDialog.setCancellable(false);
Where mDialog is the dialog object.

How to show dialog animation like this? [duplicate]

This question already has an answer here:
How to make whatsapp type of animation for opening the menu from toolbar(actionbar)
(1 answer)
Closed 7 years ago.
I want to show such animation on click on floating action button:
What is this animation is called? How to implement it in Android?
PS. This animation in youtube: https://www.youtube.com/watch?v=Vdo95zNo408&feature=youtu.be&t=15
https://github.com/markushi/android-ui
try this link. It's have Reveal effect.

Categories

Resources