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
13
votes
2 answers

Display DialogFragment content below status bar

Im trying to display an DialogFragment with match_parent both for height and width but it happens that on top the DialogFragment is being displayed below StatusBar. The DialogFragment is applying some default value for padding on bottom, right,…
13
votes
4 answers

View outside a Dialogs bounds

I want something like this: The users profile picture is "popping out" over the dialogs bounds. I've tried everything: messing with clipping with every possibly combination under the sun, dynamically creating the view after the dialog and adding it…
eth0
  • 4,977
  • 3
  • 34
  • 48
13
votes
3 answers

Custom checkbox style in dialog

I'm constructing a dialog with multi-choice items (checkboxes): AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setMultiChoiceItems(arrayResource, selectedItems, new DialogInterface.OnMultiChoiceClickListener() { //…
yprez
  • 14,854
  • 11
  • 55
  • 70
13
votes
2 answers

Android: Using default style in a custom dialog title

I'm trying to create a custom multiple choice alert dialog that allows the user to select/deselect all items in one click. I achieve this using a custom title with an additional checkbox. Everything works fine except that I don't know how to make my…
Jean-Marc Astesana
  • 1,242
  • 3
  • 16
  • 24
12
votes
2 answers

AlertDialog with selector

I am trying to do a Dialog with a selector that looks exactly like this: I've tried using an AlertDialog that holds a ListView, but that gives an ugly black border between the ListView and the bottom gray area. I could use a normal Dialog, but I…
pgsandstrom
  • 14,361
  • 13
  • 70
  • 104
12
votes
3 answers

Material dialog library - prevent dismissing/closing the dialog on onPositive function call

I am using this Material Dialog library and when I click the positive button, the onPositive function is called and the dialog is closed. How can I prevent the dialog from closing/dismissing? Thanks for answers.
Ololoking
  • 1,577
  • 4
  • 22
  • 37
11
votes
1 answer

DialogPreference cause error onDisplayPreferenceDialog()

I would like to create a simple (yes/no) dialog preference, I followed the the answers in this post - creating a DialogPreference from XML But I get an error saying java.lang.IllegalArgumentException: Tried to display dialog for unknown preference…
11
votes
7 answers

AlertDialog won't wrap content no matter what I try

Here is my xml file for my dialog
Jeffrey Chou
  • 331
  • 2
  • 4
  • 15
11
votes
1 answer

DataBinding With Android Dialog

I have implemented DataBinding in Activity, Fragment and RecyclerView. Now trying to do it in Dialog, but little bit confuse about how to set custom view inside it? Here is code i have implemented for Dialog. Dialog dialog = new…
Ravi
  • 34,851
  • 21
  • 122
  • 183
11
votes
3 answers

Dim the background using PopupWindow in Android

Can I dim the background using a PopupWindow instead of a Dialog? I am asking this because I am using Dialogs but the Dialog doesn't show below the item clicked and with the PopupWindow I already have the popup showing below the item.
11
votes
3 answers

Focus issue in ListView EditText display in Dialog in Android

I have to display ListView contains EditText on Dialog, where a user can type the text in EditText and its content should not be lost. For example, I have 10 EditText in listview, if the user types "11" in first EditText , "22" in second EditText ,…
Jayesh
  • 3,661
  • 10
  • 46
  • 76
11
votes
6 answers

Dialog size does not match the background image

I am using the Android SDK to make a game. Along the way, I need to display popup/dialog like any other game there user can upgrade or whatever. The problem I have is with the size of the dialog. I am using RelativeLayout and I am setting the…
Snake
  • 14,228
  • 27
  • 117
  • 250
11
votes
5 answers

Custom Dialog size to match Theme.Holo.Light.Dialog

If I have an Activity that has it's theme set to Theme.Holo.Light.Dialog, it will scale great. It will fill the screen on phones in portrait mode almost entirely but in landscape mode it won't stretch unreasonably long. For example, in this picture…
MikkoP
  • 4,864
  • 16
  • 58
  • 106
11
votes
1 answer

How to open a Dialog from a text entry on a PreferenceScreen?

In my Android app I want to show a Dialog if the user selects on something that looks like plain text in a PreferenceScreen. I have seen How to open AlertDialog from preference screen?, but that solution launches from a CheckBoxPreference. In my…
gcl1
  • 4,070
  • 11
  • 38
  • 55
10
votes
6 answers

Prevent dialog to be opened multiple times when resuming activity

In my Android application, in order to ask the user if he/she wants to resume a current game, I display a dialog saying "Do you want to resume current game? Yes - No" on the main game activity. The thing is that if I resume various times this…
thomaus
  • 6,170
  • 8
  • 45
  • 63