Questions tagged [dialogfragment]

An Android Fragment that displays a dialog window, floating on top of its activity's window.

472 questions
12
votes
1 answer

Dialogs and Popups in Android

The Android design documentation in http://developer.android.com/design/building-blocks/dialogs.html makes a clear differentiation between Dialogs, Alerts, Popups and Toasts. It also recommends the implementation of Dialogs by means of the…
leo9r
  • 2,037
  • 26
  • 30
12
votes
3 answers

How to safely dismiss DialogFragment in onstop()?

I need to dismiss DialogFragment in onStop() of an FragmentActivity if it is showing, this is what I did if(mAlertDlg != null && mAlertDlg.getDialog() != null) mAlertDlg.dismiss(); But I usually got IllegalStateException. So please tell me why…
Wayne
  • 6,361
  • 10
  • 46
  • 69
12
votes
2 answers

Android: NullPointerException at DialogFragment.dismissInternal at DialogFragment.dismissAllow

Crash app when show ProgressDialog. I'm testing on my phone with a slide-out keyboard. When dialog is show I slide keyboard and app crashes. public static class ProgressDialogFragment extends DialogFragment { public ProgressDialogFragment() …
11
votes
0 answers

How to Android dialog (fullscreen, embedded) as in Google Calendar app

What I'd like to achive A small/large screen behavior as it is implemented by Google in its Calendar app. For example when you create a new event, on a large screen a 'dialog' opens that darkens the Activity in the background the Toolbar always…
bam
  • 302
  • 2
  • 10
11
votes
1 answer

Returning data from a DialogFragment to an Adapter

I'm trying to use an interface to return data from a DialogFragment to the ArrayAdapter from which it's shown. I've read something similar here, but I don't know how to call in the DialogFragment the function returning the data. Anybody can…
jul
  • 36,404
  • 64
  • 191
  • 318
10
votes
4 answers

Hide keyboard when showing DialogFragment on tablet?

I am using DialogFragment with ListView (to list all customer) and EditText (to search from list), it's working fine. But, whenever the dialog shows from the fragment, the keyboard is always shown and the user needs to resign. Is there any way to…
Sugan S
  • 1,782
  • 7
  • 25
  • 47
10
votes
4 answers

How to hide the onscreen keyboard when a DialogFragment is canceled by the setCanceledOnTouchOutside event

If an edittext is currently focused and the user clicks outside of the DialogFragment; I want the on screen keyboard to disappear. I can get it to work for when the DialogFragment is dismissed this way: InputMethodManager imm; public View…
JaRay
  • 164
  • 1
  • 9
9
votes
2 answers

DialogFragment is always resized when soft keyboard is opened

I'm having some issues with an custom DialogFragment that is displayed Fullscreen. This dialog has content that is scrollable and has an autocompletetextview. Initially the dialog is displayed with an margin at the top - set programmatically as an…
Ionut Negru
  • 6,186
  • 4
  • 48
  • 78
9
votes
3 answers

DialogFragment has blue line on top in Android 4.4.2

There's a blue line appearing on top of my dialog fragment that I can't get rid off(I don't even know why does it appear in the first place. Does anybody know on how to get rid of this? I have tested it on several devices and it works just fine on…
9
votes
3 answers

Android 6.0 DatePickerDialog Theme

Seems like anyone using Marshmallow (Android 6.0) is not able to use the DatePicketDialog within my app. There appears to be some sort of theme issue that I'm encountering. I use a DialogFragment which contains a DatePicketDialog for the user to…
Mike Walker
  • 2,944
  • 8
  • 30
  • 62
9
votes
7 answers

Up ActionBar action on DialogFragment

I have a DialogFragment that is styled to full screen using setStyle(STYLE_NORMAL, R.style.Theme_App). The DialogFragment shows fine but the up action (the homeAsUp action on the ActionBar) does not work. I tried implementing onOptionsItemSelected…
9
votes
1 answer

AutoCompleteTextView allow only suggested options

I have a DialogFragment that contains AutoCompleteTextView, and Cancel and OK buttons. The AutoCompleteTextView is giving suggestions of usernames that I'm getting from server. What I want to do is to restrict the user to be able to enter only…
8
votes
2 answers

While passing Android DialogFragment arguments, onCreateDialog bundle agument is unexpectedly null

I am trying to display a basic dialog in Android using a DialogFragment using an argument for the dialog message as described in StackOverflow thread and DialogFragment documentation. My problem is that the Bundle argument savedInstanceState in…
mattm
  • 5,851
  • 11
  • 47
  • 77
7
votes
1 answer

How to display another fragment on top of BottomSheetDialogFragment

Is there any way to display fragment on top of DialogFragment? When my BottomSheetDialogFragment is shown after some action I need to display another fragment (not type of dialog fragment) without dismiss of the that dialog, I tried to remove dim…
7
votes
4 answers

Android: support DialogFragment with custom layout not shown

I've had a subclass of DialogFragment (android.support.v4.app.DialogFragment) in my app that worked fine for a long time. The dialog itself was constructed in onCreateDialog() callback. Now, however, I want to transition to a new dialogs layout and…
Vasiliy
  • 16,221
  • 11
  • 71
  • 127
1
2
3
31 32