sandalone
sandalone

Reputation: 41749

Navigation drawer forces app name and icon to appear shortly on startup

Each time I start the app, the application name and icon appears very shortly on the left side over the drawer icon. This ruins the look of the custom ActionBar style.

How can I remove it? I already tried the top solution from StackOverflow, but they all refer to completely hiding the ActionBar. I don't want to hide it as I need it. I just don't know where to turn off this irritating display.

Note: I've let the Android Studio create the Navigation Drawer project for me so all the code came from the default creation.

EDIT

This is the code which appears in 3 locations: restoreActionBar, setUp and showGlobalContextActionBar. I am talking about the default Android Studio drawer project.

public void restoreActionBar() {
    ActionBar actionBar = getActionBar();
    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
    actionBar.setDisplayShowTitleEnabled(false);
    actionBar.setDisplayShowHomeEnabled(false);
    actionBar.setDisplayHomeAsUpEnabled(false);

// actionBar.setTitle(mTitle); }

Upvotes: 0

Views: 338

Answers (2)

Paul Burke
Paul Burke

Reputation: 25584

Best method is to set the display options to useLogo in your theme. E.g.

<style name="AppTheme" parent="android:Theme.Holo.Light">
    <item name="android:actionBarStyle">@style/AppTheme.ActionBar</item>
</style>

<style name="AppTheme.ActionBar" parent="android:Widget.Holo.Light.ActionBar.Solid">
    <item name="android:displayOptions">useLogo</item>
</style>

This won't actually show the logo (if set) because showHome is not included.

Upvotes: 1

Revathi
Revathi

Reputation: 172

Try to use these

actionBar.setDisplayHomeAsUpEnabled(false); actionBar.setDisplayShowTitleEnabled(false);

Upvotes: 1

Related Questions