I tried to implement android.support.v4.app.ActionBarDrawerToggle in my application; since this class is deprecated
This class is deprecated. Please use ActionBarDrawerToggle in Support-v7-AppCompat.
I switched to android.support.v7.app.ActionBarDrawerToggle.
Before I could call the constructor as follows:
mDrawerToggle = new ActionBarDrawerToggle( this, mDrawerLayout, R.drawable.ic_drawer, R.string.drawer_open, R.string.drawer_close ){ public void onDrawerClosed(View view) { getActionBar().setTitle(mTitle); invalidateOptionsMenu();
but after switching to a newer v7 support library I get an error
"ActionBarDrawerToggle() in ActionBarDrawerToggle cannot be applied to: toolbar: android.support.v7.widget.Toolbar Actual arguments: R.drawable.ic_drawer (int)"
Apparently, I do not represent the correct toolbar in the constructor, but I'm not sure I understand the difference between the two conflicting arguments. How to get the necessary toolbar?
android navigation-drawer
Cristiano colacillo
source share