18

How do I remove the top title bar that's default in an Android app?

enter image description here

The gray Hello, Android bar?

Brianjs
  • 2,079
  • 2
  • 20
  • 32
  • 1
    What do you want to do? Just remove it and have no title bar or replace it with your own custom title bar? Did you at least try googling it first because I just googled your title and it gave me a bunch of good results.. – Matt Wolfe Mar 05 '12 at 03:15
  • this may be a duplicate of http://stackoverflow.com/questions/2446373/android-title-bar-removal and potentially http://stackoverflow.com/questions/2445999/what-do-i-have-to-add-to-a-layout-to-hide-the-titlebar/2446087#2446087 – Matt Wolfe Mar 05 '12 at 03:17
  • Thank you, for some reason I didn't find anything right away. I suppose I would rather use a custom title bar than just remove it. – Brianjs Mar 05 '12 at 03:22
  • Throws and error. I am assuming because I cannot access theme twice? Is there a workaround? MyTheme.NoTitleBar does not work either – Brianjs Mar 05 '12 at 03:44

9 Answers9

35

Its very simple to remove the title bar Just, Add the android:theme property to your AndroidManifest.xml

<application android:theme="@android:style/Theme.NoTitleBar">
Lucifer
  • 29,392
  • 25
  • 90
  • 143
  • 1
    `` Throws and error. I am assuming because I cannot access theme twice? Is there a workaround? MyTheme.NoTitleBar does not work eithe – Brianjs Mar 05 '12 at 04:19
  • do you have that Theme installed in your device ? – Lucifer Mar 05 '12 at 04:20
  • MyTheme or Theme? Mytheme is linking to new background image – Brianjs Mar 05 '12 at 04:22
  • This information is indeed right when you are developing an app but what if I want to change that bar size and colour in EVERY app? I am looking for the ROM parameters about this (I think)... – Pitto Nov 12 '12 at 09:41
23
<style name="MyTheme" parent="@android:style/Theme.NoTitleBar">
    <item name="android:windowNoTitle">true</item>
    <item name="android:windowBackground">@drawable/xyz</item>
</style>
Sai mukesh
  • 712
  • 3
  • 9
  • This was the solution to my ending problem.Thank you very much! But was not my original question so I cannot mark solution for others sake. – Brianjs Mar 05 '12 at 15:31
  • That's it... combining your theme with the native on... thanks – luigi7up May 30 '13 at 10:30
5

enter image description here

Go into manifest file

Click the "Application" tab on the bottom (as shown)

Enter @android:style/Theme.NoTitleBar (as shown)

EGHDK
  • 17,818
  • 45
  • 129
  • 204
3

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!

SavinienL
  • 191
  • 1
  • 5
3

This problem occurs when you are using default inbuilt toolbar and your own custom toolbar. There are two method.

1) Navigate to Values/style.xml <---Base Application theme styles to-> and change your parent theme like:

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
</style>
  1. Another method is to add theme attributes to your activity as in manifest file:

    android:theme = "@style/Theme.AppCompat.Light.NoActionBar"

Suman Astani
  • 1,181
  • 11
  • 16
3

Try this:

requestWindowFeature(Window.FEATURE_NO_TITLE);
Mariusz Jamro
  • 30,615
  • 24
  • 120
  • 162
Nitesh Khosla
  • 875
  • 8
  • 20
1

And also several themes are available without the title bar. For e.g.Theme.AppCompat.Light.NoActionBar applies the respective theme without title bar

prodeveloper
  • 943
  • 14
  • 22
1

For Android Studio 2.2.2, 2016

Replace in app/src/main/res/values/styles.xml the parent Theme.AppCompat.Light.DarkActionBar on Theme.AppCompat.NoActionBar

Example:

<resources>
    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.NoActionBar">
        <!-- Customize your theme here. -->
    </style>
</resources>
blackchestnut
  • 1,259
  • 10
  • 15
0
android:theme="@android:style/Theme.NoTitleBar"

inside AndroidManifest.xml I added the code =)

Andrej Gaspar
  • 231
  • 2
  • 8