title: android AlertDialog with transparent background
body: <p>I have a custom AlertDialog and I want to make it's background completely transparent.
  Normally to make an activity completely transparent, I do the following</p>
  <ul>
  <li><p>set background to <code>#00000000</code> in the xml layout</p>
  </li>
  <li><p>in the manifest set <code>android:theme=&quot;@android:style/Theme.Holo.Dialog&quot;</code> for the activity.</p>
  </li>
  <li><p>In onCreate add <code>getWindow().setBackgroundDrawable(new ColorDrawable(0))</code>.</p>
  <p>But now that I am dealing with a Dialog, how do I accomplish transparency?</p>
  </li>
  </ul>
  <p>Here is the dialog code:</p>
  <pre><code>LayoutInflater inflater = getLayoutInflater();
      View dialoglayout = inflater.inflate(R.layout.activity_mine1,
          (ViewGroup) findViewById(R.layout.mine1));
      mine1 = new AlertDialog.Builder(this);
      mine1.setView(dialoglayout);
      mine1.show();
  </code></pre>
  <p>And my xml is just a relativeLayout with other child views:</p>
  <pre><code>&lt;RelativeLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      xmlns:tools=&quot;http://schemas.android.com/tools&quot;
      android:layout_width=&quot;wrap_content&quot;
      android:layout_height=&quot;wrap_content&quot;
      android:background=&quot;#00000000&quot; &gt;
  
      ...
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  <p>Note: I have already looked at some similar posts here, but they don't seem to work.</p>
  <p>My real reason is that the background that I really want to use, is not rectangular. I get it to work in an activity. But I want to use a dialog instead.</p>
  <p>EDIT:</p>
  <p>Further playing around, I have this <code>style.xml</code></p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;resources xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&gt;
  &lt;style name=&quot;CustomDialog&quot; parent=&quot;android:Theme.Holo.Dialog&quot;&gt;
          &lt;item name=&quot;android:windowIsTranslucent&quot;&gt;true&lt;/item&gt;
          &lt;item name=&quot;android:windowBackground&quot;&gt;@android:color/transparent&lt;/item&gt;
      &lt;/style&gt;
  &lt;/resources&gt;
  </code></pre>
  <p>Which I add as</p>
  <pre><code>new AlertDialog.Builder(this, R.style.CustomDialog)
  </code></pre>