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
119
votes
11 answers

Can't make the custom DialogFragment transparent over the Fragment

I need to create a dialog over a fragment (that takes up the whole screen). The dialog needs to be a floating dialog that will be positioned over the fragment with the fragment darkened out outside of the fragment.. For the custom Dialog, i have a…
112
votes
8 answers

How do I maintain the Immersive Mode in Dialogs?

How do I maintain the new Immersive Mode when my activities display a custom Dialog? I am using the code below to maintain the Immersive Mode in Dialogs, but with that solution, the NavBar appears for less than a second when I start my custom…
VanDir
  • 1,980
  • 3
  • 23
  • 41
108
votes
18 answers

Android get full width for custom Dialog

in my application my created custom dialog dont have full height and i can not change and customize that.for example see this screen shot: My code: final Dialog contacts_dialog = new Dialog(ActivityGroup.this,…
DolDurma
  • 15,753
  • 51
  • 198
  • 377
81
votes
5 answers

How to create a number picker dialog?

I want to be able to create a Dialog that allows the user to pick a number from a specified range. I know that there are existing widgets(like those from quietlycoding and the one by SimonVT) that already does this but I'm having hard time…
Razgriz
  • 7,179
  • 17
  • 78
  • 150
79
votes
5 answers

Proper way of dismissing DialogFragment while application is in background

I started using DialogFragment, because they are working nicely through orientation changes, and stuff. But there is nasty problem I encountered. I have AsyncTask that shows progress DialogFragment and dismisses it onPostExecute. Everything works…
Sver
  • 3,349
  • 6
  • 32
  • 53
54
votes
9 answers

Get date from datepicker using dialogfragment

I'm using the google example to insert a datepicker inside my app using a dialogfragment http://developer.android.com/guide/topics/ui/controls/pickers.html But I'm not sure how to get date after set it (not java expert). Dialog and datepicker runs…
Gonzalo Cao
  • 2,286
  • 1
  • 24
  • 20
52
votes
9 answers

How do I fire an event when click occurs outside a dialog

I would like to know how to solve a problem I've got. I have a Dialog which pops up in an activity. The Dialog doesn't cover the whole screen, so the buttons from the activity still show. I can easily close the dialog when there is a touch outside…
fizo07
  • 615
  • 1
  • 7
  • 7
50
votes
14 answers

Remove black background on custom dialog

I want to remove the black background on custom dialog as shown in the picture. I'm sure the black background was from the dialog, not from app's background. ; AlertDialog code public class MyAlertDialog extends AlertDialog { public…
pengwang
  • 19,536
  • 34
  • 119
  • 168
46
votes
5 answers

Adding positive / negative Button to DialogFragment's Dialog

I've already written a DialogFragment. Now I've realized that I want it to have a positive and a negative button just like an AlertDialog. How can I achieve such a thing while maintaining the code that I've written? public class DoublePlayerChooser…
Libathos
  • 3,340
  • 5
  • 36
  • 61
39
votes
18 answers

How to disable BottomSheetDialogFragment dragging

How to disable BottomSheetDialogFragment dragging by finger? I saw similar questions, but they're all about BottomSheet not BottomSheetDialogFragment.
36
votes
2 answers

How to display progress dialog before starting an activity in Android?

How do you display a progress dialog before starting an activity (i.e., while the activity is loading some data) in Android?
35
votes
8 answers

Create a custom dialog with radio buttons list

I've got a method in which i have a list of values: /** * ISO * */ public void getISO(View view) { // Open dialog with radio buttons List supported_isos = preview.getSupportedISOs(); …
Atlas91
  • 5,754
  • 17
  • 69
  • 141
30
votes
5 answers

AlertDialog: How To Remove Black Borders Above and Below View

This question has been asked before: AlertDialog custom title has black border But was not answered satisfactorily - and is missing some information. I'm trying to create a custom dialog in Android without a title and without any buttons along the…
Steve
  • 31,144
  • 19
  • 99
  • 122
28
votes
11 answers

Android 6.0 Dialog text doesn't appear

I updated my phone to Android 6.0 and I have these 2 problems with dialogs: 1)The title is shown but the messages isn't for alert dialog(SOLVED): new AlertDialog.Builder(context).setTitle("Title").setMessage("Message"); 2)Also custom…
28
votes
10 answers

Android Error: Unable to add window -- token null is not for an application

Hy. I tried to create an alert dialog but when I run my application, is throw an exception 09-26 12:43:21.949: E/AndroidRuntime(14618): FATAL EXCEPTION: main 09-26 12:43:21.949: E/AndroidRuntime(14618): android.view.WindowManager$BadTokenException:…
user2576008
  • 499
  • 1
  • 6
  • 15
1
2
3
97 98