O'Reilly logo

Xamarin Studio for Android Programming: A C# Cookbook by Mathieu Nayrolles

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

Mastering fragments

Fragments are yet another component that are offered by the Android platform, which can be used inside the Activity that you learned about in Chapter 3, Mastering the Life and Death of Android Apps. Fragments encapsulate behavior, functionality, or even user interface in an easy-to-reuse format. Also, fragments have their own life cycle so many of them can be combined in the same activity and they can communicate with each other very much like Intents do (which is described in Chapter 8, Mastering Intents – A Walkthrough).

In this recipe, we will see how to use two different fragments in the same activity.

Getting ready

Create a new solution named Fragment_Project and open the project of the same name that Xamarin Studio has created ...

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