Note that there are some explanatory texts on larger screens.

plurals
  1. POFull Screen DialogFragment in Android
    primarykey
    data
    text
    <p>I'm trying to show an almost fullscreen DialogFragment. But I'm somehow not able to do so.</p> <p>The way I am showing the Fragment is straight from the android developer documentation</p> <pre><code>FragmentManager f = ((Activity)getContext()).getFragmentManager(); FragmentTransaction ft = f.beginTransaction(); Fragment prev = f.findFragmentByTag("dialog"); if (prev != null) { ft.remove(prev); } ft.addToBackStack(null); // Create and show the dialog. DialogFragment newFragment = new DetailsDialogFragment(); newFragment.show(ft, "dialog"); </code></pre> <p>I know naively tried to set the RelativeLayout in the fragment to fill_parent and some minWidth and minHeight.</p> <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:minWidth="1000px" android:minHeight="600px" android:background="#ff0000"&gt; </code></pre> <p>I would know expect the DialogFragment to fill the majority of the screen. But I only seems to resize vertically but only until some fixed width horizontally.</p> <p>I also tried to set the Window Attributes in code, as suggested here: <a href="http://groups.google.com/group/android-developers/browse_thread/thread/f0bb813f643604ec" rel="noreferrer">http://groups.google.com/group/android-developers/browse_thread/thread/f0bb813f643604ec</a>. But this didn't help either.</p> <p>I am probably misunderstanding something about how Android handles Dialogs, as I am brand new to it. How can I do something like this? Are there any alternative ways to reach my goal?</p> <hr> <p>Android Device:<br> Asus EeePad Transformer<br> Android 3.0.1</p> <hr> <p><strong>Update:</strong> I now managed to get it into full screen, with the following code in the fragment</p> <pre><code>@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setStyle(STYLE_NO_FRAME, android.R.style.Theme_Holo_Light); } </code></pre> <p>Unfortunately, this is not quite want I want. I definitely need a small "padding" around the dialog to show the background.</p> <p>Any ideas how to accomplish that?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload