weird behavior when applying theme to dialog under api 21
<p>I am using the theme <code>"Theme.AppCompat.Light.NoActionBar"</code> in my app .
I want to make some of my dialogs applying the dark AppCompat theme.</p>

<p>So,i created style for the dialog </p>

<pre><code> &lt;style name="MyDialogStyle" parent="Theme.AppCompat.Dialog"&gt;

 &lt;/style&gt;
</code></pre>

<p>(same issue when the parent is "Theme.AppCompat.Dialog.Alert")
one in xml file without version constrain
and the same style in xml file with  version api 21 constrain.
 to invoke the dialog i used this function :</p>

<pre><code> public void showSimplestDialog(View view) {
    AlertDialog.Builder builder = new AlertDialog.Builder(this,R.style.MyDialogStyle);
    AlertDialog alertDialog = builder.setTitle("title")
            .setMessage("message ")
            .create();
    alertDialog.show();
}
</code></pre>

<p>the result in api 21+ look fine </p>

<p><a href="https://i.stack.imgur.com/48wED.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/48wED.png" alt="enter image description here"></a></p>

<p>but in api 17 i got some duplicate background that i cant get rid off (even when i try to apply custom view to the dialog with builder.setView(MyView)</p>

<p><a href="https://i.stack.imgur.com/AJAcT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AJAcT.png" alt="enter image description here"></a></p>