I am using the theme "Theme.AppCompat.Light.NoActionBar"
in my app .
I want to make some of my dialogs applying the dark AppCompat theme.
So,i created style for the dialog
<style name="MyDialogStyle" parent="Theme.AppCompat.Dialog">
</style>
(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 :
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+ look fine
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)