title: Transparent AlertDialog has black background
body: <p>I  have a custom <code>AlertDialog</code> style that makes the <code>AlertDialog</code> box transparent. It works fine except that when I inflate my desired transparent layout into the alert dialog window, it shows up with a black background. My goal is to have a completely transparent <code>AlertDialog</code> to where it seems as if there are only 4 buttons floating rather than a frame.
  Image one is what the custom dialog is giving me, image two is my desired or what I am aiming for.</p>
  <p><strong>Here is the code to the custom <code>Dialog</code></strong></p>
  <pre><code>&lt;style name=&quot;CustomDialog&quot; parent=&quot;android:Theme.Dialog&quot;&gt;
      &lt;item name=&quot;android:windowFrame&quot;&gt;@null&lt;/item&gt;
      &lt;item name=&quot;android:windowBackground&quot;&gt;@android:color/transparent&lt;/item&gt;
      &lt;item name=&quot;android:windowIsFloating&quot;&gt;true&lt;/item&gt;
      &lt;item name=&quot;android:windowContentOverlay&quot;&gt;@null&lt;/item&gt;
      &lt;item name=&quot;android:windowTitleStyle&quot;&gt;@null&lt;/item&gt;
      &lt;item name=&quot;android:windowAnimationStyle&quot;&gt;@android:style/Animation.Dialog&lt;/item&gt;
      &lt;item name=&quot;android:windowSoftInputMode&quot;&gt;stateUnspecified|adjustPan&lt;/item&gt;
      &lt;item name=&quot;android:backgroundDimEnabled&quot;&gt;false&lt;/item&gt;
      &lt;item name=&quot;android:background&quot;&gt;@android:color/transparent&lt;/item&gt;
  &lt;/style&gt;
  </code></pre>
  <p><strong>Here is what I am calling in my <code>onCreate()</code></strong></p>
  <pre><code>AlertDialog.Builder imageDialog = new AlertDialog.Builder(TimeLine.this, R.style.CustomDialog);
  inflater = getLayoutInflater();
  View view=inflater.inflate(R.layout.tabs, null);
  AlertDialog a = imageDialog.create();
  a.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
  a.setView(view, 0, 0, 0, 0);
  
  a.show();
  </code></pre>
  <p><img src="https://i.stack.imgur.com/BVRK1.png" alt="current alert dialog" /></p>
  <p><img src="https://i.stack.imgur.com/wPckX.png" alt="Desired AlertDialog" /></p>
  <p><em><strong>Edit</strong></em>*
  <strong>The code for the tabs layout xml is here</strong>
  `</p>
  <pre><code>&lt;RelativeLayout
      android:layout_width=&quot;fill_parent&quot;
      android:layout_height=&quot;match_parent&quot;
      android:id=&quot;@+id/tabLayout&quot;
      android:background=&quot;#000000ff&quot;&gt;
  
      &lt;Button
          android:layout_width=&quot;wrap_content&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:text=&quot;New Button&quot;
          android:id=&quot;@+id/button2&quot;
          android:layout_marginTop=&quot;206dp&quot;
          android:layout_below=&quot;@+id/button4&quot;
          android:layout_alignStart=&quot;@+id/button4&quot; /&gt;
  
      &lt;Button
          android:layout_width=&quot;wrap_content&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:text=&quot;New Button&quot;
          android:id=&quot;@+id/button3&quot;
          android:layout_alignTop=&quot;@+id/button2&quot;
          android:layout_alignParentStart=&quot;true&quot; /&gt;
  
      &lt;Button
          android:layout_width=&quot;wrap_content&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:text=&quot;New Button&quot;
          android:id=&quot;@+id/button4&quot;
          android:layout_alignParentTop=&quot;true&quot;
          android:layout_alignParentEnd=&quot;true&quot;
          android:layout_marginTop=&quot;100dp&quot; /&gt;
  
      &lt;Button
          android:layout_width=&quot;wrap_content&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:text=&quot;New Button&quot;
          android:id=&quot;@+id/button&quot;
          android:layout_alignParentTop=&quot;true&quot;
          android:layout_alignParentStart=&quot;true&quot;
          android:layout_marginTop=&quot;100dp&quot; /&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  <p>`</p>
  <p>From testing to see what the source of the problem is, I have found out that it is true that the layout is transparent because when I change the background color of the layout, so does the alert dialog change. However when the layout is set to transparent, it seems that what is behind the inflated layout is black. And because of that I am unsure of what to do or whether it is the <code>AlertDialog</code> settings or my layout code.</p>