Skip to content Skip to sidebar Skip to footer

Drawer Toggle Not Working As Expected (icon Remains The Same)

I'm trying to implement an ActionBarDrawerToggle into my app but I can't make it. I've achieved to show the toggle in my toolbar, but the icon is the same always. This is toggle's

Solution 1:

implement following method with DrawerLayout instace, in your case instance is dwLayout. implement following after this line

dwLayout.setDrawerListener(dwToggle);

add this

drawerLayout.post(newRunnable() {
    @Overridepublicvoidrun() {
        // To display hamburger icon in toolbar
        drawerToggle.syncState();
    }
});

or you can do this as well

@OverrideprotectedvoidonPostCreate(Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
mDrawerToggle.syncState();
}

Post a Comment for "Drawer Toggle Not Working As Expected (icon Remains The Same)"