9. Partitioning the User Interface with Fragments

Traditionally, each screen within an Android application was tied to a specific Activity class. However, in Android 3.0 (Honeycomb), the concept of a user interface component called a Fragment was introduced. Fragments were then included in the Android Support library for use with Android 1.6 (API Level 4) and up. Fragments decouple user interface behavior from a specific Activity lifecycle. Instead, Activity classes can mix and match user interface components to create more flexible user interfaces for the Android devices of the future. You will also be introduced to the concept of nested fragments which have been added to Android 4.2.

Understanding Fragments

Fragments were added to the Android ...

Get Introduction to Android™ Application Development: Android Essentials, Fourth Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.