Questions tagged [android-dialog]

Base class for Dialogs. A dialog in Android is a small window that prompts the user to make a decision or enter additional information. A dialog does not fill the screen and is normally used for modal events that require users to take an action before they can proceed.

A dialog is usually a small window that appears in front of the current Activity. The underlying Activity loses focus and the dialog accepts all user interaction. Dialogs are normally used for notifications that should interrupt the user and to perform short tasks that directly relate to the application in progress (such as a progress bar or a login prompt).

Official Android Dialog Documentation

1460 questions
10
votes
2 answers

change the height of custom dialog in Dialog Fragment

I have created a custom dialog, the code is below. The problem is that, the height of the dialog is becoming wrap_content, i.e it is independent of what ever the height i mention in the xml. I have checked other questions, they din't help…
10
votes
1 answer

ProgressDialog in jetpack compose

I want to show Indeterminate progress dialog when user performs some action like signing up. The old way it was possible using ProgressDialog. For compose, I found this How can I render plain android ProgressBar with Compose? But this is not exactly…
10
votes
2 answers

Apple Style AlertDialog on old Android's APIs

I'm working on the Apple Style AlertDialog feature of the AndroidRate library and can't fix some bugs on Android's 9-10 APIs. I can't remove AlertDialog border on Android's 9-10 APIs API 19: API 10: I can't fix AlertDialog width on Android's…
Alexander Savin
  • 1,952
  • 1
  • 15
  • 30
10
votes
2 answers

Android Multiple File Selector/Chooser Dialog

I have been scouring the internet for a simple easy to implement Android file chooser dialog that also has the option of selecting multiple files and returning a uri or string array with all the files selected. Currently I use aFileChooser on github…
Asiimwe
  • 2,199
  • 5
  • 24
  • 36
10
votes
4 answers

How to add TextView and EditText using default AlertDialog programmatically

I've been trying to add two elements in a default AlertDialog but I can't seem to make it work. Here's my code: // START Dialog AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this); TextView tv = new TextView(this); …
10
votes
2 answers

How do you create a transparent activity that can overlay the home screen but is not dismissed when the home or back button is pressed?

In my app I'm looking to show an always-visible, semi-transparent status but am having a hard time figuring out how it is done. Facebook Messenger and a few other apps I've seen do it so I know it's possible. They use the SYSTEM_ALERT_WINDOW…
mark_w
  • 253
  • 1
  • 2
  • 9
10
votes
2 answers

AndroidRuntimeException: requestFeature() must be called before adding content

I have dialog fragment. I have intention to use this fragment in activity and dialog. And I override onCreateDialog and onCreateView method. here is coding. @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, …
10
votes
2 answers

Android: Dialog minimum margin

I use android android.app.Dialog for create a custom dialog ( for button and background ) In my Dialog I has a TextView inside a ScrollView while I has a short text this show perfecly how I want, but if the text is very big my Dialog take the full…
FIG-GHD742
  • 2,486
  • 1
  • 19
  • 27
10
votes
5 answers

Hide soft input keyboard when dialog closes

I'm opening a Dialog from within an Activity. When the dialog opens, I call ((InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE)).toggleSoftInput(InputMethodManager.SHOW_FORCED, InputMethodManager.HIDE_IMPLICIT_ONLY); The problem…
gatzkerob
  • 877
  • 2
  • 12
  • 32
9
votes
2 answers

Weird behavior when using ConstraintLayout as the root layout of a DialogFragment

I am constructing a custom dialog using a DialogFragment. I've noticed very odd behavior with various ViewGroups used as the root of the dialog's layout. I assume this is due to some strange interaction between the system's windows and how it…
9
votes
2 answers

Android dialog setNegativeButton without listener

Curiosity question here. I use a lot of dialogs builders and most of the time my negative cancel button do nothing except dismiss the dialog. The code I found everywhere on the web is this : builder.setNegativeButton( "cancel", new…
Dan Chaltiel
  • 7,811
  • 5
  • 47
  • 92
9
votes
1 answer

How can I close a ProgressDialog after a set time?

I am trying to close a ProgressDialog box automatically after 3 seconds. Here is the dialog: ProgressDialog progress = new ProgressDialog(this); progress.setTitle("Connecting"); progress.setMessage("Please wait while we connect to…
Holdfast33
  • 132
  • 1
  • 2
  • 10
9
votes
5 answers

remove white background in dialogfragment

Here's how I called my DialogFragment: DialogSelectAccount myDiag=new DialogSelectAccount(); myDiag.show(ft,"Diag" ); Here's how (partially) my DialogFragment is created: public class DialogSelectAccount extends DialogFragment { public…
9
votes
1 answer

Android L Circular Reveal on a Dialog

I'm trying to create a circular reveal on a Dialog. I would think that you would be able to get the View in the onCreate of the Dialog, hide it, and then reveal it using ViewAnimationUtils.createCircularReveal. I'm having issues getting the View…
9
votes
5 answers

android custom dialog background

I need to show a custom dialog in my Android application. Standard AlertDialog design is unacceptable. Android docs say: Tip: If you want a custom dialog, you can instead display an Activity as a dialog instead of using the Dialog APIs. Simply…
Nick
  • 3,205
  • 9
  • 57
  • 108