Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hide app title in android? [closed]

Tags:

android

I want to hide the app title bar.

like image 851
ryan Avatar asked May 19 '10 02:05

ryan


People also ask

How do I hide my app title?

To hide the Title Bar using the Android Manifest. xml file you need to set the Android theme to NoTitleBar like this: android:theme="@android:style/Theme. NoTitleBar">

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.


3 Answers

You can do it programatically:

import android.app.Activity; import android.os.Bundle; import android.view.Window; import android.view.WindowManager;  public class ActivityName extends Activity {     @Override     public void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         // remove title         requestWindowFeature(Window.FEATURE_NO_TITLE);         getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,             WindowManager.LayoutParams.FLAG_FULLSCREEN);         setContentView(R.layout.main);     } } 

Or you can do it via your AndroidManifest.xml file:

<activity android:name=".ActivityName"     android:label="@string/app_name"     android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"> </activity> 

Edit: I added some lines so that you can show it in fullscreen, as it seems that's what you want.

like image 99
Cristian Avatar answered Nov 08 '22 14:11

Cristian


use

<activity android:name=".ActivityName"            android:theme="@android:style/Theme.NoTitleBar"> 
like image 39
Vitaliy A Avatar answered Nov 08 '22 13:11

Vitaliy A


You can do it programatically: Or without action bar

//It's enough to remove the line
     requestWindowFeature(Window.FEATURE_NO_TITLE);

//But if you want to display  full screen (without action bar) write too

     getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
     WindowManager.LayoutParams.FLAG_FULLSCREEN);

     setContentView(R.layout.your_activity);
like image 25
chaon Avatar answered Nov 08 '22 13:11

chaon