Questions tagged [dismiss]

For questions related to calling the "dismiss" method in a button click listener.

By calling this method in a button click listener, the user can close a dialog and continue using the application.

633 questions
469
votes
31 answers

How can I dismiss the on screen keyboard?

I am collecting user input with a TextFormField and when the user presses a FloatingActionButton indicating they are done, I want to dismiss the on screen keyboard. How do I make the keyboard go away automatically? import…
Collin Jackson
  • 110,240
  • 31
  • 221
  • 152
254
votes
17 answers

Receive result from DialogFragment

I am using DialogFragments for a number of things: choosing item from list, entering text. What is the best way to return a value (i.e. a string or an item from a list) back to the calling activity/fragment? Currently I am making the calling…
James Cross
  • 7,799
  • 8
  • 24
  • 30
85
votes
9 answers

How to dismiss a DialogFragment when pressing outside the dialog?

I am using a DialogFragment, and while I have successfully set an image to close (i.e. dismiss) the dialog when pressed, I am having a hard time finding the way to dismiss the dialog when the user clicks anywhere outside it, just as it works with…
sole
  • 2,057
  • 2
  • 17
  • 18
79
votes
11 answers

single function to dismiss all open view controllers

I have an app which is a single view application. I have a navigation controller linked up to all child controllers from the root view controller. In each child controller, I have a logout button. I'm wondering if I can have a single function I can…
user2363025
  • 6,365
  • 19
  • 48
  • 89
76
votes
3 answers

Prevent user from dismissing notification

Some apps have notifications which can´t be dismissed by swiping them away. How can I manage such behaviour?
Marian Klühspies
  • 15,824
  • 16
  • 93
  • 136
52
votes
8 answers

How to dismiss AlertDialog in android

I created AlertDialog that contains 4 buttons OptionDialog = new AlertDialog.Builder(this); OptionDialog.setTitle("Options"); LayoutInflater li = (LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE); View v…
Emy Alsabbagh
  • 1,087
  • 3
  • 13
  • 22
50
votes
10 answers

Dismiss more than one view controller simultaneously

I'm making a game using SpriteKit. I have 3 viewControllers: selecting level vc, game vc, and win vc. After the game is over, I want to show the win vc, then if I press OK button on the win vc, I want to dismiss the win vc AND the game vc (pop two…
codeinjuice
  • 664
  • 1
  • 5
  • 14
47
votes
22 answers

iPhone - dismiss multiple ViewControllers

I have a long View Controllers hierarchy; in the first View Controller I use this code: SecondViewController *svc = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:nil]; [self presentModalViewController:svc…
Oscar Peli
  • 1,108
  • 2
  • 11
  • 18
46
votes
2 answers

sendUserActionEvent() returned

I got the following error when a popup dismisses using android studio. The code works OK, but the following error appears on logcat: E/ViewRootImpl: sendUserActionEvent() returned. java code: LayoutInflater layoutInflater =…
Soheil Ghasemi
  • 461
  • 4
  • 4
40
votes
9 answers

How to dismiss AlertDialog.Builder?

In the following code below, how do I dismiss the alert box? I don't want to cause a memory leak. I tried the .dismiss() on alertDialog, but that didn't work... Thanks // User pressed the stop button public void StopMsg_button_action(View view){ …
sneaky
  • 2,141
  • 9
  • 31
  • 38
34
votes
4 answers

How to know if a dialog is dismissed in Android?

If the dialog is dismissed,I want to do something for my background.So I want to know if the dialog is dismissed
Marshal Chen
  • 1,985
  • 4
  • 24
  • 35
27
votes
7 answers

Dismissing multiple modal view controllers at once?

So have a stack with three view controllers where A is root, B is first modal view controller and C is third modal vc. I would like to go from C to A at once. I have tried this solution to dismiss.It does work but not in a correct way. That is when…
sebrock
  • 1,214
  • 2
  • 15
  • 32
22
votes
4 answers

iOS dismiss UIAlertView beforing showing another

I have a Utils class which shows UIAlertView when certain notifications are triggered. Is there a way to dismiss any open UIAlertViews before showing a new one? Currenty I am doing this when the app enters the background using [self…
booboo-a-choo
  • 779
  • 2
  • 8
  • 14
19
votes
8 answers

How to disable snackbar's swipe-to-dismiss behavior

Is there a way to prevent the user from dismissing a snackbar by swiping on it? I have an app that shows a snack bar during network login, I want to avoid it to be dismissed. According to Nikola Despotoski suggestion I've experimented both…
Paolone
  • 475
  • 1
  • 7
  • 16
17
votes
3 answers

How to dismiss a modal VC with fade out animation?

I am using the following code in my presenting VC to fade in the child modal VC, and this works fine: self.infoViewController.view.alpha = 0.0; [self.navigationController presentModalViewController:self.infoViewController animated:NO]; [UIView…
Gruntcakes
  • 37,738
  • 44
  • 184
  • 378
1
2 3
42 43