0

I want to change the base theme of my application but every time I try, the application is terminating. I used to read the first comment from this question without any positive result. I'm attaching my AndroidManifest.xml and styles.xml.

Android.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.fighttimer.stambeto09.fighttimer" >
<uses-sdk android:targetSdkVersion="15" android:minSdkVersion="7"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".MainActivity"
        android:label="@string/app_name"
        android:screenOrientation="portrait">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

styles.xml

<style name="AppBaseTheme" parent="android:Theme.Holo.NoActionBar.Fullscreen">
</style>
<style name="AppTheme" parent="AppBaseTheme">

</style>

Community
  • 1
  • 1
Stanimir Yakimov
  • 864
  • 3
  • 14
  • 31
  • possible duplicate of [Android: Theme.Holo.Light.NoActionBar vs Theme.Light.NoTitleBar](http://stackoverflow.com/questions/14061661/android-theme-holo-light-noactionbar-vs-theme-light-notitlebar) – M D Feb 17 '15 at 08:44
  • [http://tips.androidhive.info/2013/10/android-make-activity-as-fullscreen-removing-title-bar-or-action-bar/](http://tips.androidhive.info/2013/10/android-make-activity-as-fullscreen-removing-title-bar-or-action-bar/) – M D Feb 17 '15 at 08:44
  • @MD I've tried these cases before writing this questing. – Stanimir Yakimov Feb 17 '15 at 09:01

1 Answers1

0

try this snippet for fullscreen with no ActionBar

<style name="Theme" parent="android:style/Theme">
    <item name="android:windowContentOverlay">@null</item>
    <item name="android:windowBackground">@color/yourbackgroundcolor</item>
    <item name="android:windowNoTitle">true</item>
</style>



<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/Theme" >
    <activity
        android:name=".MainActivity"
        android:label="@string/app_name"
        android:screenOrientation="portrait">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>
williamj949
  • 11,166
  • 8
  • 37
  • 51
  • POst your logcat as to where it is terminating – williamj949 Feb 17 '15 at 08:51
  • It looks like is IllegalStateException. 02-17 10:53:29.604 29228-29228/com.fighttimer.stambeto09.fighttimer E/AndroidRuntime﹕ FATAL EXCEPTION: main java.lang.RuntimeException: Unable to start activity ComponentInfo{com.fighttimer.stambeto09.fighttimer/com.fighttimer.stambeto09.fighttimer.MainActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. – Stanimir Yakimov Feb 17 '15 at 08:54
  • change your to minSDKversion=14 – williamj949 Feb 17 '15 at 08:55
  • Still the same problem – Stanimir Yakimov Feb 17 '15 at 08:58
  • Okay, I found the right answer. It's the first comment from [here](http://stackoverflow.com/questions/21814825/you-need-to-use-a-theme-appcompat-theme-or-descendant-with-this-activity) – Stanimir Yakimov Feb 17 '15 at 09:25