Martinocom
Martinocom

Reputation: 330

Android Navigation Drawer little "bug"

I'm very, VERY new in android. So, I started with a simple application, created on min API 14, I personalized some strings and I started to modify the application drawer.

When I tried to debug my simple app and launch it on my Nexus 5 (updated to last stock lollipop), I have this little annoying bug, with this icons:

Menu is closed Menu is opened

In all cases, when the navigation drawer is opened/closed it shows that ARROW, instead of changing between the "menu" icon and "arrow" icon. What I'm doing wrong?

Searching for a solution, I found some lines in code, like this:

restoreActionBar MainActivity

I don't know how to do... If you could explain me what's wrong, I'll be very happy.

Upvotes: 1

Views: 178

Answers (1)

David Passmore
David Passmore

Reputation: 6099

You need to syncState() call of your ActionBarDrawerToggle object from onPostCreate():

@Override
protected void onPostCreate(Bundle savedInstanceState) {
    super.onPostCreate(savedInstanceState);
    // Sync the toggle state after onRestoreInstanceState has occurred.
    mDrawerToggle.syncState();
}

Upvotes: 2

Related Questions