0
votes

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^^

1

1 Answers

0
votes

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" />