I have an activity with many fragments that uses action bar and navigation drawer. It has \"home as up\" enabled. I have implemented proper logic that only top level fragmen
If you use AppCompatActivity, you can get the right drawer icon and back icon by
if(homeUp)
{
getSupportActionBar().setDisplayHomeAsUpEnabled(false);
mDrawerToggle.setDrawerIndicatorEnabled(false);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
mDrawerToggle.setToolbarNavigationClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
}
});
}
else
{
mDrawerToggle.setDrawerIndicatorEnabled(true);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
mDrawerToggle.syncState();
}
Without need for getV7DrawerToggleDelegate :D