android – Can't change drawer icon for NavigationDrawer-ThrowExceptions

Exception or error:

I’m trying to implement the new NavigationDrawer provided since the last Android keynote.

I got everything up and running, the navigation drawer opens and closes when pressing on the icon on the top left corner.

But now I still have the arrow icon although I replaced it with the ic_drawer from Android. Why?

Here’s my code where I specified the icon:

mDrawerToggle = new ActionBarDrawerToggle(
            R.drawable.ic_drawer, //<-- This is the icon provided by Google itself

But the application still runs with the standard icon of setDisplayHomeAsUpEnabled.

Any ideas?

How to solve:

I just got the Navigation Drawer working. I had forgotten to add following methods also provided by the examples:

protected void onPostCreate(Bundle savedInstanceState) {
    // Sync the toggle state after onRestoreInstanceState has occurred.

public void onConfigurationChanged(Configuration newConfig) {


I had the same problem the answer is if you are setting


then the normal up icon is shown. So try without using it

Leave a Reply

Your email address will not be published. Required fields are marked *