Skip to content

Instantly share code, notes, and snippets.

getSupportFragmentManager().addOnBackStackChangedListener(new FragmentManager.OnBackStackChangedListener() {
ValueAnimator anim;
@Override
public void onBackStackChanged() {
if (getSupportFragmentManager().getBackStackEntryCount() > 0) {
// getSupportActionBar().setDisplayHomeAsUpEnabled(true); // show back button
anim = ValueAnimator.ofFloat(0, 1);