I'm using the Material Design (Android Support V7 AppCompat) and using the Support Toolbar instead of the ActionBar. But I've noticed that the Back Button it's gone, on previous versions of Android, when adding to the back stack a Fragment Transaction, automatically added the Back Button, now it's gone. The only way I found to show the Back Button, it's using an Activity and calling it.
Have someone found and resolved this?
Thanks!
EDIT
I'm using a DrawerLayout and an ActionBarDrawerToggle, now, I've used the answer that was given and used this:
private FragmentManager.OnBackStackChangedListener mOnBackStackChangedListener = new FragmentManager.OnBackStackChangedListener() {
@Override
public void onBackStackChanged() {
boolean displayHomeAsUpEnabled = getSupportFragmentManager().getBackStackEntryCount() > 0;
getSupportActionBar().setDisplayHomeAsUpEnabled(displayHomeAsUpEnabled);
}
};
FragmentManager it's from android.support.v4. Now, when returning to the Home Screen, the 'Home' (Hamburger button) disappears. I now it's because "setDisplayHomeAsUpEnabled" it's on false... But how do I show the home button again?, on previous versions of Android, just adding the back stack and having the back stack to 0 were enough to show the Home Button and the Back Button.
Thanks