Questions tagged [dialogfragment]

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

444 questions
4
votes
2 answers

Starting DialogFragment from a class extending RecyclerView.ViewHolder

I tried as below at onClick() method of recyelerview.viewholder class. SampleDialogFragment used in the sample extends DialogFragment. @Override public void onClick(View v) { SampleDialogFragment df= new…
4
votes
0 answers

AlertDialog not visible in Hierarchy Viewer

I have a fragment-based app that I'm trying to analyze using the Hierarchy Viewer. My problem is that the views I need to analyze are not showing up in the Viewer, though they are clearly present in the emulator. I have a FragmentActivity that…
4
votes
2 answers

Android get rid of DialogFragment floating margin

I'm displaying a dialogfragment in my app and I notice that even when I set the fragments' y position to the bottom of the screen there's still a margin visible: Display display = getActivity().getWindowManager().getDefaultDisplay(); …
Jon
  • 7,273
  • 6
  • 38
  • 99
4
votes
2 answers

NumberPicker not working inside DialogFragment

I'm learning the basics of android programming and having some trouble with a NumberPicker. I am close to what I want to have, the dialog opens and the hour and minute number pickers appear, but they do not have numbers above and below to scroll…
4
votes
2 answers

Android DialogFragment not showing when show() called in onCreate of Activity

I have a dialog fragment with a simple indeterminate progress bar in the centre, which i use to show network activity: public class NativeLoadingDialogFragment extends DialogFragment { public NativeLoadingDialogFragment() { //…
4
votes
2 answers

Retaining listener after screen rotation - DialogFragment with DatePicker

When clicking an EditText field in my (Scherlock)FragmentActivity a DatePicker shows up. After selecting date and clicking "apply" the Edittext field is populated with the date. This works fine until i rotate the screen while the DatePicker is…
4
votes
1 answer

Passing data from dialogfragment to fragment

I got an activity with three fragments and from one of these fragments i'm calling a MyDialogFragment.show()-method. Dialog appears, I do some text-input and try to pass this text-input back to fragment. So far so good. I set up the…
mauricemoss
  • 150
  • 3
  • 9
4
votes
2 answers

DialogFragment with multiple activities

I used the documentation here to create a dialogfragment. The code is : public static MyAlertDialogFragment newInstance(int title) { MyAlertDialogFragment frag = new MyAlertDialogFragment(); Bundle args = new Bundle(); …
previouslyactualname
  • 673
  • 1
  • 10
  • 23
4
votes
1 answer

Android - DialogFragment with Layout Containing Fragment

I am using a customized DialogFragment. In the onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) method, I inflate a layout that contains another fragment causing the app to crash. How can I fix it?
Abdalrahman Shatou
  • 4,285
  • 6
  • 45
  • 72
3
votes
1 answer

Pass touch event from dialog fragment to View right below (inside the parent activity)

As you can see in the image , red border rectangle is the parent activity . Blue one is dialog fragment . The circle is indicating a view and rectangle below is the description. I want the click on circle to be passed down to the button. So far i…
3
votes
1 answer

Activity with Dialogfragment is always in the middle

The image above is my current activity with a dialog fragment. as you can see dialog is in the middle of the screen but it want it to look something like in google maps where when I click on the button the dialog appears near the button: => As…
3
votes
1 answer

DialogFragment over keyboard

I got a login Activity with EditText. The user starts typing and the keyboard is shown. After some time I'm trying to show a DialogFragment (Over the entire activity AND the keyboard) The problem is that the keyboard gets disappear. Is there a way…
dor506
  • 4,466
  • 7
  • 37
  • 67
3
votes
3 answers

Generic DialogFragment with listeners

I want to create a DialogFragment subclass that can be reused accross my app. So when an Activity wants to create a DialogFragment, it can set its own texts and attach its own listeners for the positive and negative buttons. For the texts inside the…
3
votes
2 answers

Chain a Dialog Fragment Result in RxJava

How we can chain a dialog fragment within an RxJava chain and wait for its result (which button is clicked). Something like: buttonClickObservable.flatMap(v -> showDialogAndWaitForResponse()).subscribe(dialogResult -> doSomething()); Is this even…
3
votes
2 answers

Xamarin.Android DialogFragment some LifeCycle Events not firing

I am having an issue working with Xamarin.Android (please see code below) MainActivity.cs: using Android.App; using Android.Widget; using Android.OS; namespace DialogFragmentLife { [Activity(Label = "DialogFragmentLife", MainLauncher = true)] …