The following is the first few sections of a chapter from Exploring Android, plus headings for the remaining major sections, to give you an idea about the content of the chapter.


Setting Up the Action Bar

Next up is to configure the action bar to our ToDo application. The action bar is that bar at the top of your activity UI, showing your app’s title. It can also have toolbar-style buttons and an “overflow menu”, each holding what are known as action items. In this tutorial, we will add an action bar item to launch an “about” page, though we will not actually show that page until a later tutorial.

This is a continuation of the work we did in the previous tutorial. The book’s GitHub repository contains the results of the previous tutorial as well as the results of completing the work in this tutorial.

Starting in this tutorial, we will begin editing Java source files. Some useful Android Studio shortcut key combinations are:

NOTE: Copying and pasting Java code from this book may or may not work, depending on what you are using to read the book. For the PDF, some PDF viewers (e.g., Adobe Reader) should copy the code fairly well; others may do a much worse job. Reformatting the code with Ctrl-Alt-L (Command-Option-L on macOS) after pasting it in sometimes helps.

Read Me!

This tutorial assumes that you have learned the basics of the action bar elsewhere. That could be:

Step #1: Adding an Icon

The preview of this section is being chased by zombies.

Step #2: Defining an Item

The preview of this section is en route to Mars.

Step #3: Loading and Responding to Our Options

The preview of this section was eaten by a grue.

Step #5: Trying It Out

The preview of this section took that left turn at Albuquerque.

Step #6: Dealing with Crashes

The preview of this section will not appear here for a while, due to a time machine mishap.

What We Changed

The preview of this section is presently indisposed.