My app is showing name and icon. I want to hide name.
How i can do that?
My app is showing name and icon. I want to hide name.
How i can do that?
You have to call `
getSupportActionBar().setDisplayShowTitleEnabled(false)
- to hide it,
or
getSupportActionBar().setTitle("new title");
- if you want to change it
Kinda "workaround", but it's working fine:
In the Manifest
<activity
android:name=".YourActivity"
android:label="" />
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 ...
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.
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">
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.
just replace parent property for appTheme style in styles.xml to '@android:style/Theme.NoTitleBar'