0

I'm programming an application on android, and I've a little problem : I would like to make a customiz Dialog box so I do like in the android documentation :

In my manifest :

<application
        android:allowBackup="true"
        android:icon="@drawable/indice"
        android:label="33"
        android:theme="@style/AppTheme">

<activity android:name=".Autres.Indice"
        android:theme="@android:style/Theme.Holo.Dialog">

        </activity>

In style :

<style name = "AppTheme" parent="@style/Theme.AppCompat.NoActionBar">
    </style>

But when I run : Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.

I don't understand, thank's^^

  • possible duplicate of [ActionBarCompat: java.lang.IllegalStateException: You need to use a Theme.AppCompat](http://stackoverflow.com/questions/18063395/actionbarcompat-java-lang-illegalstateexception-you-need-to-use-a-theme-appcom) – appoll May 07 '15 at 09:58
  • Possible duplicate of [You need to use a Theme.AppCompat theme (or descendant) with this activity](https://stackoverflow.com/questions/21814825/you-need-to-use-a-theme-appcompat-theme-or-descendant-with-this-activity) – Utshaw Jun 18 '17 at 11:41

1 Answers1

0

You are having this issue because the activity you are trying to apply the dialog theme to is not extending Activity, that requires AppCompat theme.

Change

    android:theme="@style/AppTheme">

For

    android:theme="@style/Theme.AppCompat" />
Jordi Castilla
  • 26,609
  • 8
  • 70
  • 109