I have simple code to create simple navigation drawer, but when i declare parameter for ActionBarDrawerToggle it\'s say that drawable icon cannot be applied...
Gradl
There are two ActionBarDrawerToggle classes. The support.v4's and the support.v7's. Then, it is very cofusing, the v7's constructor methods are different from v4's.
You may fix it simply by removing the third argument drawerImageRes.
drawerListener = new ActionBarDrawerToggle(
this,
drawerLayout,
// R.drawable.ic_drawer, <== delete this argument
R.string.drawer_open,
R.string.drawer_close
) {
@Override
public void onDrawerOpened(View drawerView) {
Toast.makeText(MainActivity.this, "Drawer Opened",
Toast.LENGTH_SHORT).show();
}
@Override
public void onDrawerClosed(View drawerView) {
Toast.makeText(MainActivity.this, "Drawer Closed",
Toast.LENGTH_SHORT).show();
}
};
Change
import android.support.v4.app.ActionBarDrawerToggle;
to
import android.support.v7.app.ActionBarDrawerToggle;