Is there anyway to remove activity label bar and label itself which is set by default from application label? I'd like to have whole layout from my design and need to remove the label bar and label which is in TOP layout.
16 Answers
You can achieve this by setting the android:theme
attribute to @android:style/Theme.NoTitleBar
on your <activity>
element in your AndroidManifest.xml like this:
<activity android:name=".Activity"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

- 39,405
- 19
- 98
- 102
-
3If you want to remove the title bar and app label but keep using a theme (such as `Theme.Holo.Light`) check out [this answer](http://stackoverflow.com/a/10318745/1438809). – Felix Jul 06 '13 at 02:46
-
14In my case, i assume thats because appcompat and new API levels is : `android:theme="@style/Theme.AppCompat.NoActionBar"` – Lyoneel Jul 20 '15 at 03:41
-
`java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.` – Michael Jan 04 '19 at 18:07
If your application theme is AppTheme(or anything else), then in styles.xml add the following code:
<style name="HiddenTitleTheme" parent="AppTheme">
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
</style>
Then in manifest file add the following in the activity tag for which you want to disable activity label:
android:theme="@style/HiddenTitleTheme"

- 496
- 4
- 11
-
2This worked for me because otherwise with,"@android:style/Theme.NoTitleBar" I got this error" You need to use a Theme.AppCompat theme (or descendant) with this activity.". thank you – Fire Crow Feb 19 '18 at 03:20
-
in case someone doesn't know how where to put the styles https://developer.android.com/guide/topics/ui/look-and-feel/themes#Styles – MartianMartian Jan 21 '22 at 21:10
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);
}

- 727
- 10
- 24
I am not 100% sure this is what you want but if you are referring to the title bar (the little gray strip at the top), you can remove/customize it via your manifest.xml file...
<activity android:name=".activities.Main"
android:theme="@android:style/Theme.NoTitleBar">

- 52,720
- 19
- 113
- 137
you can try this
ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayShowTitleEnabled(false);

- 109
- 1
- 2
- 11
You have two ways to hide the title bar by hiding it in a specific activity or hiding it on all of the activity in your app.
You can achieve this by create a custom theme in your styles.xml
.
<resources>
<style name="MyTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
</resources>
If you are using AppCompatActivity, there is a bunch of themes that android provides nowadays. And if you choose a theme that has .NoActionBar
or .NoTitleBar
. It will disable you action bar for your theme.
After setting up a custom theme, you might want to use the theme in you activity/activities. Go to manifest and choose the activity that you want to set the theme on.
SPECIFIC ACTIVITY
AndroidManifest.xml
<application
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name">
<activity android:name=".FirstActivity"
android:label="@string/app_name"
android:theme="@style/MyTheme">
</activity>
</application>
Notice that I have set the FirstActivity
theme to the custom theme MyTheme
. This way the theme will only be affected on certain activity. If you don't want to hide toolbar for all your activity then try this approach.
The second approach is where you set the theme to all of your activity.
ALL ACTIVITY
<application
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/MyTheme">
<activity android:name=".FirstActivity"
android:label="@string/app_name">
</activity>
</application>
Notice that I have set the application theme to the custom theme MyTheme. This way the theme will only be affected on all of activity. If you want to hide toolbar for all your activity then try this approach instead.

- 1,355
- 1
- 17
- 26
There's also a drop down menu in the graphical layout window of eclipse. some of the themes in this menu will have ".NoTitleBar" at the end. any of these will do trick.

- 7,583
- 13
- 49
- 69
In my case, the others answers was not enough...
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="android:windowNoTitle">true</item>
<item name="android:windowFullscreen">true</item>
</style>
<application
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
</application>
Tested on Android 4.0.3 API 15.

- 1,072
- 15
- 21
-
3The problem with this solution, as the other post mentions, is that the title bar does show for a brief moment. When I ran into this problem I ended up using the solution that Octavian shows because it's cleaner and you don't run into the temporary title bar issue. – McStretch Dec 08 '10 at 13:45
In your project "res/values/themes" edit style tag attribute for parent from
parent="Theme.MaterialComponents.DayNight.DarkActionBar"
to:
parent="Theme.MaterialComponents.DayNight.NoActionBar"
do this for both theme.xml files, it will remove ActionBar and keep default theme.

- 31
- 1
- 7
-
This was the problem for me, I used the android studio templates to setup my app and these parents seem to override all of the `windowActionBar` things. Also work noting you need to remove the call to `setupActionBarWithNavController` after doing this – Peter Frost Jun 05 '23 at 16:11
you can use this in your activity tag in AndroidManifest.xml to hide label
android:label=""

- 2,937
- 33
- 60

- 117
- 1
- 9
-
1but then the name of the app doesn't show on the home screen among all other apps.. – busuu Jul 21 '17 at 12:28
-
This was the correct solution for me. Our app theme extends `Theme.MaterialComponents.Light.NoActionBar` which has `windowNoTitle` set to `true` but still the app_name flashes up briefly on startup. This fix works. – MikeMcC Mar 05 '21 at 10:50
IF you are using Android Studio 3+ This will work: android:theme="@style/Theme.AppCompat.NoActionBar"
@android:style/Theme.NoTitleBar will not support in new API and force you app close.

- 74
- 1
- 10
Whenever I do rake run:android,
my Androidmenifest.xml file is built-up again so my changes done
for NoTitlebar no more persist.
Rather than user adroid_title: 0
This helped me.
edit your build.yml
android: android_title: 0 #rest of things #you needed

- 2,869
- 3
- 22
- 22
First way set the activity theme to NoTitleBar
android:theme="@style/android:Theme.NoTitleBar"
Second way to ignore it
tools:ignore="SpeakableTextPresentCheck"

- 111
- 3
- 13
with your toolbar you can solve that problem. use setTitle method.
Toolbar mToolbar = (Toolbar) findViewById(R.id.toolbar);
mToolbar.setTitle("");
setSupportActionBar(mToolbar);
super easy :)

- 1
-
Unfortunately, this only removes the title, not the entire ActionBar. The ActionBar can be completely removed from a specific Activity in the Manifest. – Craig Jul 26 '17 at 16:50
-
`getSupportActionBar()?.hide()` would hide the bar if this approach is preferred and you want to do more than remove the text – SMAG Dec 22 '20 at 06:06