O'Reilly logo

Mastering Android Application Development by Antonio Pachón Ruiz

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

Fragments

In this section, we are going to review briefly the key concepts of fragments to explain advanced features and components, such as Fragment Manager and the fragments back stack.

In our example, we will create an activity called MainActivity and four fragments: ListFragment, ContactFragment, SettingsFragment, and DetailsFragment. For this, you can create a fragments package and double-click on the package to go to New | Fragment | Blank Fragment. Take a look at the following dialog box:

Fragments

For now, you can create them without the fragment factory methods and the interface callbacks. We will cover these later in the chapter.

Our project so far ...

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