How to insert a Toolbar in ActionBarDrawerToggle?

2

I want to insert an icon as Toolbar , but my Android Studio reports a conversion error for Toolbar ... this is the code from which it reports the error:

actionBarDrawerToggle = new ActionBarDrawerToggle(this, drawerLayout,
                        R.mipmap.ic_launcher, R.string.drawer_open, DesR.string.drawer_close) { 
    ...
    ... 
};

It gives error insertion of " R.mipmap.ic_launcher

    
asked by anonymous 05.04.2015 / 05:05

1 answer

1

I think the reason is because you are using support.v7.app .

This in itself is not a problem, the issue is that the ActionBarDrawerToggle class constructor of support.v7 is different from support.v4.

The constructor of the class in v7 does not have the drawerImageRes parameter

In your code do not include the parameter R.mipmap.ic_launcher when calling the constructor:

actionBarDrawerToggle = new ActionBarDrawerToggle(this, drawerLayout,
                        R.string.drawer_open, R.string.drawer_close)
    
05.04.2015 / 11:44