Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove title bar in android?

I want to do android program that contains no title bar. For some reason I cant remove title bar. I have already tried this coding.

this.requestWindowFeature(Window.FEATURE_NO_TITLE);

This one also I have tried but the program suddenly stops..

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

How can I fix this?

like image 752
ChrisHarry Avatar asked Jan 31 '15 04:01

ChrisHarry


People also ask

How do I disable the title bar?

So basically we just need to change DarkActionBar to NoActionBar. NoActionBar theme prevents the app from using the native ActionBar class to provide the app bar. Thus it removes the title of every activity. Another way for removing the title specifically from an activity is by using a getSupportActionBar().

What is title bar in android?

The Title bar is a small part of the UI that you can supply with some text and a color. You see it on a lot of Android 2.0 Apps. See here. The Actionbar is the bar with buttons that has back navigation etc. If you can chose, you use it instead of the Titlebar.


1 Answers

This won't work on Android Studio. You need to edit your AndroidManifest.xml and add this line to the Activity in which you want the window title to be removed:

<activity
    ...    
    android:theme="@style/Theme.AppCompat.NoActionBar"
    ...
    >

If you require the title to be removed on all activities I suggest to pick a title-less App Theme.

like image 164
icortesi Avatar answered Sep 21 '22 16:09

icortesi