Hello Friends i implement one Demo Applicaiton for DrawerLayout in All Android Device
MainClass as below :
import java.util.Locale;
import android.
Stuck in the same problem from the same tutorial after applying all the suggestions of the other answers, I've found (a few moments ago) that it's the invalidateOptionsMenu(); too that creates a problem.
You've to use the supportInvalidateOptionsMenu(); and it magically works.
mDrawerToggle = new ActionBarDrawerToggle(
this, /* host Activity */
mDrawerLayout, /* DrawerLayout object */
R.drawable.ic_drawer, /* nav drawer image to replace 'Up' caret */
R.string.drawer_open, /* "open drawer" description for accessibility */
R.string.drawer_close /* "close drawer" description for accessibility */
) {
public void onDrawerClosed(View view) {
getSupportActionBar().setTitle(mTitle);
supportInvalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()
}
public void onDrawerOpened(View drawerView) {
getSupportActionBar().setTitle(mDrawerTitle);
supportInvalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()
}
};