Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Removing title bar of android application

Tags:

java

android

I'm making a small android application, and I want to remove the android title bar.

I've tried using the

this.requestWindowFeature(Window.FEATURE_NO_TITLE);

But it still makes the title bar show for 0,1 second when the application starts. I would love to make it not even show it when the app is loading.

I've searched a bit around, and somebody mentions that you can change the style of the app, but I have no idea how to do that. I've only just started making apps, so I don't have a lot of experience.

like image 930
Loyalar Avatar asked Feb 23 '12 09:02

Loyalar


People also ask

How do I remove the title bar from my app?

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().

How do I get rid of the app bar on Android?

If you want to hide Action Bar from the entire application (from all Activities and fragments), then you can use this method. Just go to res -> values -> styles. xml and change the base application to “Theme. AppCompat.

How do I show and hide the title bar?

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


2 Answers

try this:

in your application tag in manifest add android:theme,like follow:

<application android:theme="@android:style/Theme.NoTitleBar" ...>

like image 171
idiottiger Avatar answered Sep 17 '22 16:09

idiottiger


To do that I declared a style inheriting everything from my general style. This style disabled the default Android titleBar.

<style name="generalnotitle" parent="general">
    <item name="android:windowNoTitle">true</item>
</style>

Create a new style and add this style in your different views or add this code in the default style to disabled the titleBar for all windows!

like image 23
SavinienL Avatar answered Sep 20 '22 16:09

SavinienL