Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hide title bar from the beginning

I am using following code to replace title bar.

    final boolean customTitleSupported = requestWindowFeature(Window.FEATURE_NO_TITLE);
    setContentView(R.layout.main);

And it's working fine once UI loaded. Problem is however when I start the app, the ugly gray bar appears for 1-2 seconds until UI loaded. Is there any way to specify not showing the default title bar at all?

like image 432
Tae-Sung Shin Avatar asked Nov 21 '11 21:11

Tae-Sung Shin


2 Answers

If you want the titlebar to be gone in every activity within your app, then add

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

to your manifest. Not 100% sure though that this will prevent the titlebar from showing up momentarily, but it should work.

like image 134
LuxuryMode Avatar answered Sep 18 '22 12:09

LuxuryMode


In the Manifest file, add this line inside the application tag

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

It will hide the bar from all the activities. If you want to hide it from a specific activity, add the same line to that activity's tag.

Good Luck !

like image 21
iTurki Avatar answered Sep 22 '22 12:09

iTurki