Chapter 5. Exploring Fragments, AppWidgets, and the System UI

In this chapter, we will cover the following topics:

  • Creating and using a Fragment
  • Adding and removing Fragments during runtime
  • Passing data between Fragments
  • Creating a shortcut on the Home screen
  • Creating a Home screen widget
  • Adding Search to the Action Bar
  • Showing your app full screen

Introduction

With a firm understanding of layouts from Chapter 2, Layouts, we'll dig deeper into UI development with Fragments. Fragments are a way to separate your UI into smaller sections that can easily be reused. Think of Fragments as mini-activities, complete with their own classes, layouts, and lifecycle. Instead of designing your screen in one Activity Layout, possibly duplicating functionality across ...

Get Android Application Development Cookbook - 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.