5.3.4. Managing Fragments

A parent Activity manages its Fragments with a FragmentManager (package android.app) that’s returned by the Activity’s getFragmentManager method. If the Activity needs to interact with a Fragment that’s declared in the Activity’s layout and has an Id, the Activity can call FragmentManager method findFragmentById to obtain a reference to the specified Fragment. As you’ll see in Chapter 8, a FragmentManager can use FragmentTransactions (package android.app) to dynamically add, remove and transition between Fragments.

Get Android™ How to Program, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.