As we discussed, fragments provide us with the ability to closely control and manage our application user interface. Through the use of the FragmentTransaction
class, we can provide the user with the experience of moving from one screen to another by simply switching between different fragments. This takes us to an entirely new way of thinking: a brave new world of application design.
When creating our user interface in this way, the activity acts as a sort of screen manager, with the fragments implementing the screens themselves. This concept of managing the individual application screens as fragments within an activity is so powerful that it has become the foundation of some of the most compelling navigation features of the Android platform.
Android provides classes that cooperate with this design pattern to enable us to create rich navigation and screen management experiences in a simple way.