O'Reilly logo

Creating Dynamic UI with Android Fragments by Jim Wilson

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

Dynamically managing fragments

The process of dynamically managing fragments commonly involves multiple steps. The steps may be simple like removing one fragment and adding another, or they may be more complex, involving the removal and addition of multiple fragments. In any case, we need to be certain that all dynamic changes to the fragments within an activity that constitute a shift from one application screen to the next occur together as a single unit of work. Android does this by grouping the steps into transactions using the FragmentTransaction class.

Conceptually, the FragmentTransaction class behaves in a manner consistent with other transaction models: start the transaction, identify the desired changes, and commit the transaction once ...

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