-1

I need to remove action bar/ title bar from all activities I am using. Currently I applied

android:theme="@android:style/Theme.Holo.Light.NoActionBar.Fullscreen"

in Manifest file under activity but this only removes above said from the main activity other activity remains the same. Any solution

Full code under activity :

<activity
            android:name="com.dss.ms.MainActivity"
            android:label="@string/app_name"            
            android:theme="@android:style/Theme.Holo.Light.NoActionBar.Fullscreen">

Full Manifest file

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.dss.ms"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="12"
        android:targetSdkVersion="19" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:largeHeap="true"
        android:theme="@android:style/Theme.NoTitleBar.Fullscreen" 
 >

        <meta-data
            android:name="com.google.android.gms.games.APP_ID"
            android:value="@string/app_id" />
        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />

        <activity
            android:name="com.dss.ms.MainActivity"
            android:label="@string/app_name"            
            >

            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name="com.com.dss.ms.Single"
            android:label="@string/title_activity_single" >
        </activity>
        <activity
            android:name="com.dss.ms.Index"
            android:label="@string/title_activity_index" >
        </activity>
        <activity
            android:name="com.dss.ms.da"
            android:label="@string/title_activity_players_2" >
        </activity>
        <activity
            android:name="com.dss.ms.FullscreenActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:label="@string/title_activity_fullscreen"
            android:theme="@style/FullscreenTheme" >
        </activity>
        <activity
            android:name="com.dss.ms.Score"
            android:label="@string/title_activity_score" >
        </activity>
    </application>

</manifest>

Final Edit ---

I got it worked, The problem arises when activity extends ActionBarActivity. I am attaching the reference. [ActionBarCompat: java.lang.IllegalStateException: You need to use a Theme.AppCompat

In my final code I am using :

android:theme="@android:style/Theme.Holo.Light.NoActionBar.Fullscreen"

under application in my Manifest file. Thank you.

Community
  • 1
  • 1
user3521965
  • 29
  • 1
  • 5

5 Answers5

7

This code use in manifest file in :-

<application
    android:allowBackup="true"
    android:icon="@drawable/app_icon"
    android:label="@string/app_name"
    android:largeHeap="true"
    android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
MysticMagicϡ
  • 28,593
  • 16
  • 73
  • 124
Rutvij
  • 493
  • 3
  • 10
3

You have to set Theme or your application in application tag of your proiject's manifest file like:

<application 
       android:theme="@android:style/Theme.DeviceDefault.Light.NoActionBar.Fullscreen" >
</application>
Pankaj Arora
  • 10,224
  • 2
  • 37
  • 59
3

Add this to your main activity inside onCreate

    //Remove title bar
    this.requestWindowFeature(Window.FEATURE_NO_TITLE);


    //Remove notification bar
     this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,      
     WindowManager.LayoutParams.FLAG_FULLSCREEN);

    //set content view AFTER ABOVE sequence (to avoid crash)
     this.setContentView(R.layout.your_layout_name_here);

add this to all pages

2

Set this Theme to your Application Level like

 <application
    android:icon="@drawable/logo"
    android:label="@string/app_name"
    android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
 ....
 ...
 </application>
M D
  • 47,665
  • 9
  • 93
  • 114
1

Just add

android:theme="@android:style/Theme.Holo.Light.NoActionBar.Fullscreen"

to application tag instead of activity

MysticMagicϡ
  • 28,593
  • 16
  • 73
  • 124