title: How to make a custom alertdialog fullscreen
body: <p>I wish to make a custom <code>AlertDialog</code> full screen like a new activity screen.</p>
  
  <p>Tried these answers and still not working</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/18315343/android-make-a-dialog-appear-in-fullscreen">Android make a dialog appear in fullscreen</a></li>
  <li><a href="https://stackoverflow.com/questions/21514267/make-alertdialog-custom">Make AlertDialog Custom</a></li>
  <li><a href="https://stackoverflow.com/questions/38544436/how-to-make-an-alert-dialog-in-full-screen-in-android">How to make an Alert dialog in full screen in Android?</a></li>
  </ul>
  
  <pre class="lang-java prettyprint-override"><code>public void newDialog(final Context c){
  
      final AlertDialog alertDialog;
  
      LayoutInflater layoutInflater = LayoutInflater.from(c);
      dialogueView = layoutInflater.inflate(R.layout.layout_dialogue, null);
  
      final AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(c);
      alertDialogBuilder.setView(dialogueView);
  
      alertDialog = alertDialogBuilder.create();
  
      dialogueView.findViewById((R.id.closeBtn)).setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
              alertDialog.dismiss();
          }
      });
  
      alertDialog.show();
  }
  </code></pre>
  
  <p>layout_dialogue.xml  </p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.constraint.ConstraintLayout 
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  style="@style/full_screen_dialog"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:background="@drawable/frame"&gt;
  
  &lt;android.support.design.widget.FloatingActionButton
      android:id="@+id/closeBtn"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:background="@drawable/background_sky"
      android:clickable="true"
      app:layout_constraintEnd_toEndOf="parent"
      app:layout_constraintTop_toTopOf="parent"
      app:srcCompat="@android:drawable/ic_delete" /&gt;
  
  &lt;/android.support.constraint.ConstraintLayout&gt;
  </code></pre>
  
  <p>style.xml</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;style name="full_screen_dialog" parent="@android:style/Theme.Dialog"&gt;
      &lt;item name="android:windowNoTitle"&gt;true&lt;/item&gt;
      &lt;item name="android:windowFullscreen"&gt;true&lt;/item&gt;
      &lt;item name="android:windowIsFloating"&gt;true&lt;/item&gt;
  &lt;/style&gt;
  </code></pre>
  
  <p>I had also tried </p>
  
  <pre class="lang-java prettyprint-override"><code>android.R.style.Theme_Black_NoTitleBar_Fullscreen  
  
  ViewGroup.LayoutParams params = getDialog().getWindow().getAttributes();
  params.width = WindowManager.LayoutParams.MATCH_PARENT;
  params.height = WindowManager.LayoutParams.MATCH_PARENT;
  </code></pre>
  
  <p>None of them are working for me. Any suggestion on how to accomplished it?</p>