How to insert a Toolbar into Actionbardrawertoggle?

Asked

Viewed 265 times

2

I want to insert an icon like Toolbar but my Android Studio denounces a conversion error to Toolbar... this is the code from which he denounces the error:

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

it gives error in inserting the " R.mipmap.ic_launcher

  • how do I complete my method then? actionBarDrawerToggle = new Actionbardrawertoggle (this, drawerLayout, "WHAT TO INSERT HERE?" , R.string.drawer_open, R.string.drawer_close) { ... };

1 answer

1

I think the reason is because I’m using support.v7.app.

This in itself is no problem, the question is that the constructor of the class Actionbardrawertoggle of support.v7 is different from support.v4.

The class builder in v7 does not have the parameter MageRes

Do not include the parameter in your code R.mipmap.ic_launcher when calling the builder:

actionBarDrawerToggle = new ActionBarDrawerToggle(this, drawerLayout,
                        R.string.drawer_open, R.string.drawer_close)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.