An Android Fragment that displays a dialog window, floating on top of its activity's window.
Questions tagged [dialogfragment]
472 questions
0
votes
1 answer
DialogFragment: constant height of the central view
I have a DialogFragment which consists of three parts, from up to down: the title, the central view which displays all the contents, and the bottom pane which holds the PositiveButton "OK":
public Dialog onCreateDialog(Bundle…

Leszek
- 1,181
- 1
- 10
- 21
0
votes
1 answer
Custom DialogFragment (extends BottomSheetDialogFragment), java.lang.IllegalStateException: Fragment already added
I have a Custom DialogFragment, got java.lang.IllegalStateException: Fragment already added. First I got the same crash when I click on the button quickly to show the DialogFragment. Then I override show() , remove the fragment before show.it seems…

mywjyw
- 1
0
votes
1 answer
What to enter in context of dialog in onClickListener?
I am trying to make a unit converter by following a youtube video. The problem is that he's doing all that in his main activity while I'm doing all that in a fragment. The errors are in the java class of the fragment UnitConverterFragment.java…

Huzaifa Khan
- 13
- 5
0
votes
1 answer
Convert Fragment to Dialog Fragment with navArgs, How to navigate to DialogFragment from outside the Fragment class
I want to navigate to DetailsFragment onClick of the list item (book_item.xml)
book_item.xml
...
Now it works fine for Fragment (Full Screen)
I want to make it…

krishnaacharyaa
- 14,953
- 4
- 49
- 88
0
votes
2 answers
DialogFragment SetCancelable(false) not working
Please help me guys. I tried to put SetCancelable(false) in dialogfragment but still not working.
this is my DialogFragment:
public static class UsageAcessDialogFragment extends DialogFragment {
@Override
public Dialog…

Jin Appsdev
- 21
- 5
0
votes
1 answer
Kotlin - String from Edittext in DialogFragment don't save in data class
I have one Edittext in DialogFragment and that create a new group. When I press "OK" Group is created but without string.
I try figure out but complitly I don't know where is mistake.
my DialogFragment:
class NewCategory(val listener:…

Matt
- 33
- 5
0
votes
1 answer
How to pass data from RecyclerView to DialogFragment in Kotlin?
My RecyclerView has a list of items, each item has it's clickable "delete icon", which removes item from the list. How can I use DialogFragment for confirmation of removal?
Here is a code for FeedAdapter (my RecyclerView adapter):
class…

vad070
- 35
- 3
0
votes
1 answer
Recycler View and DialogFragment struggling (Kotlin)
Hello i am using a recyclerView to swipe and call for a Dialog fragment
The the idea is that when i dismiss the dialog Fragment the raw come back to the original place
but the problem is that it return, just after the dialog is opened.
So i do…

Rodrigo Barboza
- 15
- 6
0
votes
1 answer
how show text of editText in dialogFragment on MainActivity in xamarin android?
I am using dialogfragment to make login Page in Xamarin Android.
I want to click on the login button (Photo below) ,Display text of User Name in the dialog on MainActivity after dismiss.
help me please!
enter image description here
loginDialog…

m66666
- 3
- 1
0
votes
2 answers
Can't set text on text view in dialog fragment
I have a dialog fragment and I use databinding to bind views.
I can't set text on a text view after the dialog is created.
Here is my code :
class MyDialogFragment : DialogFragment() {
private lateinit var layout : FragmentMyDialogBinding
…

Binish Mathew
- 21
- 8
0
votes
0 answers
DialogFragment crashes when calling show()
I want to display a simple DialogFragment within a Fragment, but it crashes every time the show() method is called.
It either crashes back to the MainActivity or it throws me a NullPointer Exception that does not seem to be related to the crash…

tweekz
- 187
- 1
- 9
0
votes
1 answer
Extending DialogFragment for a MaterialDatePicker
I want to migrate from DatePickerDialog to MaterialDatePicker.
I ran into a problem when calling getDialog from MaterialDatePicker with the dialog result always null.
Is this a bug, or is the feature not supported for…

Ihdina
- 950
- 6
- 21
0
votes
1 answer
How to pass data from DialogFragment to fragment in android / Kotlin
I am new to both Android app development and Kotlin. I need to pass time from a DialogFragment to update the text of a button on a fragment (which is a tab) when the user set the time. Any suggestion how this can be done. I have read about viewModel…

MZX
- 41
- 4
0
votes
0 answers
NullPointerException when using Kotlin Synthetic
I am getting a NullPointerException when I try to access an element in the layout from a DialogFragment. I have checked that, if I call getView() inside the same DialogFragment the result is 'null'.
Thank you in advance!
This is the Activity that…

Robin
- 51
- 5
0
votes
1 answer
DialogFragment : How to prevent animating again and again? e.g. after backstage
Here is a custom DialogFragment. It works well in the single activity, but when the app is in backstage and comes back, it starts its pop-in animation again. So how to prevent this case?
public class GdtFeedbackFragment extends DialogFragment {
…