I\'m using the new toolbar from the Appcompat V7 library and I\'m making an application with navigation drawer and with fragments.
In some fragments I don\'t want to sho
Add this method in onCreate()
:
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
Then override the onOptionItemSelected()
as below:
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
onBackPressed();
return true;
default:
return super.onOptionsItemSelected(item);
}
}