To create a dynamic or multi-panel user interface on an Android system, you need to encapsulate the UI components and activity behavior into modules. Let it be flexible in your activity to toggle between display and hide.
You can use Fragment classes to create these modules, which can behave like nested activity, which define their own layouts. Manage your own life cycle.
When a fragment specifies its own layout, it can be configured as a different combination in activity and in other fragment. This allows you to change your layout configuration with different screen sizes (show one fragment at a time on a small screen and two or more at a time on a big screen).
This lesson shows you how to use fragment to create a dynamic user experience. At the same time, optimize your app's user experience on devices of different screen sizes, at the same time this can support the Android 1.6 version number.
Course
-
Create a fragment
-
Learn how to build a fragment and use its callbacks to implement fragment's basic behavior.
-
Build a flexible UI
-
Learn how to build a layout for your app that can provide different fragment configurations on different screens.
-
Communication between the fragments
-
Learn how to set a path for fragment to communicate with activity and other fragments.
Android Learning Route (20) using fragment to build dynamic UI