The only way we found is to do it manually, we created a simple linear layout for the tablet and check the view instance in action:
View layout = findViewById(R.id.navigation_layout); if (layout instanceof DrawerLayout) { drawerLayout = (DrawerLayout) layout; // initialization of drawer toggle etc. ... } else { // linear layout getSupportActionBar().setHomeButtonEnabled(false); }
source share