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()
}
};
The problem lies in the drawer_list_item.xml. You will need to remove these 2 lines:
android:background="?android:attr/activatedBackgroundIndicator"
android:minHeight="?android:attr/listPreferredItemHeightSmall"
Once those are removed it should work. Both of these items need later api versions to work correctly.