Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove app title bar android

Tags:

I know this question has been asked million times but whichever method I use is not good for me.

If I use

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

in the manifest file, the whole theme of the app changes. If I put

requestWindowFeature(Window.FEATURE_NO_TITLE); 

in the onCreate activities, it shows up shortly when starting an app.

Btw I don't have any theme selected, just using standard android.

like image 978
sparrkli Avatar asked Apr 23 '14 21:04

sparrkli


People also ask

How do I disable the title bar?

The getSupportActionBar() method is used to retrieve the instance of ActionBar class. Calling the hide() method of ActionBar class hides the title bar.

How do I show and hide the title bar?

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">


2 Answers

It is unclear what you mean by "whole theme of app changes". For API Level 11+ devices, you probably should be using @android:style/Theme.Holo.NoActionBar.

like image 89
CommonsWare Avatar answered Sep 21 '22 03:09

CommonsWare


If you add the theme to the application, it applies to the whole app.

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

You have to add it to the activity declaration.

<activity     android:name=".YourActivity"     android:theme="@android:style/Theme.NoTitleBar"/> 
like image 25
Aswin Rajendiran Avatar answered Sep 19 '22 03:09

Aswin Rajendiran