I want to change default AlertDialog theme.
None of the examples I found worked. Here is what I'm doing:
<style name="LightTheme" parent="Theme.AppCompat.Light.NoActionBar">
...
<item name="alertDialogTheme">@style/MyCustomDialog</item>
</style>
<style name="MyCustomDialog" parent="Theme.AppCompat.Light.Dialog.Alert">
<item name="android:background">#000000</item>
<item name="android:textColor">#FFFFFF</item>
</style>
Am I doing something wrong?
xml
) or class code where you are using this theme.new AlertDialog.Builder(context)
LightTheme
main app theme (which you are using e.g. in Manifest)?android:theme="@style/LightTheme"