O'Reilly logo

Android Development Tools for Eclipse by Sanjay Shah, Khirulnizam Abd Rahman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Fragment

A Fragment is an independent component that can be connected to an Activity or simply is a subactivity. Typically it defines a part of UI but can also exist with no user interface, that is, headless. An instance of fragment must exist within an activity.

Fragments ease the reuse of components for different layouts. Fragments are the way to support UI variances across different types of screens. The most popular use is for building single pane layouts for phones and multipane layouts for tablets (large screens). Fragment was introduced in Android 3.0 API 11. Fragment can also be used for supporting different layouts for portrait and landscape orientations.

A fragment stops as activity stops, and is destroyed as activity is destroyed. The ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required