I am using the theme "Theme.AppCompat.Light.NoActionBar" in my application. I want some of my dialogs to apply the dark AppCompat theme.
So, I created a style for dialogue
<style name="MyDialogStyle" parent="Theme.AppCompat.Dialog"> </style>
(same problem when the parent is "Theme.AppCompat.Dialog.Alert") the same in the xml file without version limitation and the same style in the xml file with api version 21 constrain. to call the dialog box I used this function:
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(); }
The result in api 21+ looks great

but in api 17 I have a duplicate background that I canβt get rid of (even when I try to apply a custom view to the dialog with builder.setView (MyView)

android styles dialog themes
adiel
source share