I recently migrated my app to Material Design and I stumbled upon this problem with my Alert Dialogs:
I'm applying the dialog style like this:
<item name="android:alertDialogTheme">@style/Theme.AlertDialog</item>
and Theme.AlertDialog looks like this:
<style name="Theme.AlertDialog" parent="Base.V14.Theme.AppCompat.Dialog">
<item name="colorPrimary">@color/theme_primary</item>
<item name="colorPrimaryDark">@color/theme_primary_dark</item>
<item name="colorAccent">@color/theme_accent_dark</item>
</style>
This is happening on my Kitkat device and it works fine on Lollipop. Can you help me with getting rid of that outer background?
I had the exact same symptom but for me it was actually that I had used the standard frameworks AlertDialog (and its Builder) instead of android.support.v7.app.AlertDialog, switching to use the one from the support library fixed the issue for me.
The point is here:
As ironman told me here, be sure that you import the right class.
Right :
import android.support.v7.app.AlertDialog;
Wrong :
import android.app.AlertDialog;
Add below styles . You have to customise background also.
Using below also works
Also You can set in your code by using
and this should be before setContentView
Use the theme in parent