Keep background fragments alive

This commit is contained in:
ByteHamster 2019-09-27 13:25:38 +02:00
parent 872b7a813d
commit 5b909894f4
1 changed files with 6 additions and 4 deletions

View File

@ -389,14 +389,16 @@ public class MainActivity extends CastEnabledActivity implements NavDrawerActivi
break; break;
case FLIP: case FLIP:
transaction.setCustomAnimations( transaction.setCustomAnimations(
R.anim.card_flip_right_in,
R.anim.card_flip_right_out,
R.anim.card_flip_left_in, R.anim.card_flip_left_in,
R.anim.card_flip_left_out); R.anim.card_flip_left_out,
R.anim.card_flip_right_in,
R.anim.card_flip_right_out);
break; break;
} }
transaction.replace(R.id.main_view, fragment, "main") transaction
.hide(getSupportFragmentManager().findFragmentByTag("main"))
.add(R.id.main_view, fragment, "main")
.addToBackStack(null) .addToBackStack(null)
.commit(); .commit();
} }