To create a dynamic or multi-panel user interface on an Android system, you need to encapsulate the UI component and activity behavior as a module, allowing it to switch between display and hide in your activity flexibly. You can use Fragment
classes to create these modules, which can behave like nested activity, which define their own layouts and manage their own life cycles.
When a fragment specifies its own layout, it can be configured for different combinations in activity and other fragment, so that you can modify your layout configuration for different screen sizes (one fragment on a small screen at a time, and show two or more on a big screen at a time).
This lesson shows you how to use fragment to create a dynamic user experience while optimizing your app's user experience on devices of different screen sizes, while supporting the Android 1.6 version.
Course
-
Create a fragment
-
Learn how to build a fragment and use its callbacks to implement the basic behavior of fragment.
-
Build a flexible UI
-
Learn how to build a different fragment for your app on different screens The layout of the configuration.
-
Communication between Fragments
-
Learn how to set up a fragment with activity to and other fragments communication paths.