0

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); }

sandalone
  • 41,141
  • 63
  • 222
  • 338

2 Answers2

1

Try to use these

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

Revathi
  • 172
  • 8
  • Tried it before. It still displays the title+icon on startup shortly.And I've searched for all usages of `actionBar` in the code and added these lines accordingly. – sandalone Sep 22 '14 at 11:03
  • Is there anything you have declared in your styles? – Revathi Sep 22 '14 at 11:19
1

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.

Paul Burke
  • 25,496
  • 9
  • 66
  • 62