14

My app is showing name and icon. I want to hide name.

How i can do that?

enter image description here

khawar
  • 168
  • 1
  • 1
  • 10
  • 1
    possible duplicate of [How to hide app title in android?](http://stackoverflow.com/questions/2862528/how-to-hide-app-title-in-android) – pes502 May 13 '15 at 13:28
  • It not tile bar which is action bar and use setDisplayShowTitleEnabled(false) to ActionBar. – Haresh Chhelana May 13 '15 at 13:30

7 Answers7

24

You have to call `

getSupportActionBar().setDisplayShowTitleEnabled(false) - to hide it,

or

getSupportActionBar().setTitle("new title"); - if you want to change it

Blackbelt
  • 156,034
  • 29
  • 297
  • 305
3

Kinda "workaround", but it's working fine:

In the Manifest

<activity
        android:name=".YourActivity"
        android:label="" />
Andrew
  • 36,676
  • 11
  • 141
  • 113
  • 1
    This is the solution if you don't want the title but you want to be able to have a menu - even if it's just a single icon. I had code that worked with an icon-menu-item in another activity and wanted to reuse it here. Would have been a lot of extra code to write it as a button. – Andy Weinstein May 19 '19 at 09:49
3

You can use getSupportActionBar. if you want to hide just your app name use this code in Activity of that page :

getSupportActionBar().setDisplayShowHomeEnabled(false);
   

And if you want to hide ActionBar use this

getSupportActionBar().hide();

And you can ReName your app with :

getSupportActionBar().setTitle("that name you want");

Totaly you can use:

getSupportActionBar().

and others code ...

Ebrahim Bashirpour
  • 717
  • 2
  • 10
  • 21
1

If you want to do this outside of the code, put this in your manifest:
<activity android:name=".ActivityName" android:theme="@android:style/Theme.NoTitleBar">

edit: ranjith beat me to it.

Andrew T.
  • 2,088
  • 1
  • 20
  • 42
1

It works for me

Go to Style.xml change it from

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">

to

<style name="AppTheme" parent="Theme.AppCompat.NoActionBar">
1

In Kotlin you can use:

supportActionBar?.setDisplayShowTitleEnabled(false)

The "?" is important because you can have the whole title bar disabled already because you try to set a a not existing title bar's title status to false.

moonkin
  • 353
  • 1
  • 10
0

just replace parent property for appTheme style in styles.xml to '@android:style/Theme.NoTitleBar'