0

I've added this code to onCreate in each of my activites.

requestWindowFeature(Window.FEATURE_NO_TITLE);

However, when running on my phone, there's a brief moment on loading the app where it can be seen. Is there a way to remove it altogether? I don't want the title bar on any of my activites.

Nikhil
  • 1,121
  • 2
  • 11
  • 27
  • add this code in android:theme="@android:style/Theme.Black.NoTitleBar" application tag in your manifest file... – ADT Sep 19 '13 at 05:12

8 Answers8

2

put this line in style.xml file

<style name="AppTheme" parent="AppBaseTheme">
     <item name="android:windowNoTitle">true</item>
 </style>

It will gives the new api features looks and feel and if you change the style like

android:theme="@android:style/Theme.Black.NoTitleBar

then it gives the lower version api look and feel

Sunil Kumar
  • 7,086
  • 4
  • 32
  • 50
2
requestWindowFeature(Window.FEATURE_NO_TITLE); 

should be used before setContentView();

EDIT

public void onCreate(Bundle savedInstanceState) {  
        super.onCreate(savedInstanceState);  

        //set up notitle 
        requestWindowFeature(Window.FEATURE_NO_TITLE);  
        //set up full screen
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,   
                WindowManager.LayoutParams.FLAG_FULLSCREEN);  

        setContentView(R.layout.main);  
} 
Beginner
  • 1,414
  • 2
  • 21
  • 41
1

You can define theme attribute into application tag in manifest

<application android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" ...

or can use style as

<style name="generalnotitle" parent="general">
    <item name="android:windowNoTitle">true</item>
</style>

Read more at : -

How to hide the title bar for an Activity in XML with existing custom theme

How disable / remove android activity label and label bar?

Community
  • 1
  • 1
Pankaj Kumar
  • 81,967
  • 29
  • 167
  • 186
0

You can modify your AndroidManifest.xml:

<activity android:name=".MainActivity"
          android:label="@string/app_name"
          android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen">
nedaRM
  • 1,837
  • 1
  • 14
  • 28
0

in your AndroidManifest.xml modify your activity like this.

<activity
        android:name="com.example.test.Second"
        android:label="@string/title_activity_second"
        android:theme="@android:style/Theme.Light.NoTitleBar" >
    </activity>
Rajesh
  • 2,618
  • 19
  • 25
0

In order to drop the title bar for all your activities you can change the android:theme attribute in the application tag of your manifest file as in:

<application
   android:icon="@drawable/icon"
   android:label="@string/app_name"
   android:theme="@android:style/Theme.NoTitleBar.Fullscreen"

Hope this helps

0

If you don't want to show Title bar in your whole application then you can change your base theme of your application in style.xml from project res and inside values directory.

For me it default comes like

<style name="AppBaseTheme" parent="android:Theme.Light">

and I change it to

<style name="AppBaseTheme" parent="android:Theme.Light.NoTitleBar">

and it works for me. Hope this helps you.

Deepak
  • 1,989
  • 1
  • 18
  • 20
0

In your Manifest file just paste this inside the activity tags

<android.support.v7.widget.Toolbar
            android:layout_width="0dp"
            android:layout_height="0dp"
            />
K.A. Siddiqui
  • 49
  • 1
  • 8