0

I have the following activity in my AndroidManifest.xml file:

<activity
        android:name=".gameContent.GameActivity"
        android:configChanges="orientation|screenSize"
        android:screenOrientation="portrait"
        android:theme="@android:style/Theme.NoTitleBar.Fullscreen"/>

The problem is that I get the exception when I run my project:

java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.

What is the proper XML to set the fullscreen theme for this type of activity?

Foobar
  • 7,458
  • 16
  • 81
  • 161
  • On a side note `@android:` resources are inherent to OS version - that's why there's an AppCompat library that defines them when they are not accessible (e.g. not starting with `@android:`) – mewa Mar 11 '16 at 02:52

1 Answers1

1

Try putting this in your styles.xml

<style name="AppTheme.Fullscreen" parent="@style/Theme.AppCompat.Light.DarkActionBar">
    <item name="windowActionBar">false</item>
    <item name="windowNoTitle">true</item>
    <item name="android:windowFullscreen">true</item>
    <item name="android:windowContentOverlay">@null</item>
</style>

And then in your manifest

android:theme="@style/AppTheme.Fullscreen"
monopandora
  • 77
  • 1
  • 1
  • 6