Akshat Agarwal Akshat Agarwal - 4 months ago 13
Android Question

How to get the default alert Dialog on android have a black theme

How do you get the black themed Dialog in android like shown on the android guide http://developer.android.com/guide/topics/ui/dialogs.html

I took a screen shot. Whenever I use Alert Dialog, I get the dialog on the left, I want the one on the right.

enter image description here

Answer

res/values/styles.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
        <style name="default_activity_theme" parent="@android:style/Theme.Holo"/>
</resources>

AndroidManifest.xml

<activity android:name=".ActivityMain"
          android:theme="@style/default_activity_theme"/>
Comments