lib or FragmentManager Cons 1. Knowledge about custom view lifecycle (2 methods) 2. Have to handle backpressed event manually ( 1 methods) 3. Have to handle in/out animation manually
ArrayList<>(); @Override public void onSaveInstanceState(Bundle savedInstanceState) { // Save the user's current game state savedInstanceState.putSerializable("history", history); // Always call the superclass so it can save the view hierarchy state super.onSaveInstanceState(savedInstanceState); }