Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How disable / remove android activity label and label bar?

Tags:

android

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.

like image 459
Faren Avatar asked Dec 08 '10 13:12

Faren


People also ask

How do I hide labels on android?

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 . If you are using AppCompatActivity, there is a bunch of themes that android provides nowadays.

How will you hide the title of an activity?

The requestWindowFeature(Window. FEATURE_NO_TITLE) method of Activity must be called to hide the title.


2 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> 
like image 52
Octavian A. Damiean Avatar answered Sep 24 '22 06:09

Octavian A. Damiean


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" 
like image 42
Md. Avatar answered Sep 24 '22 06:09

Md.