O'Reilly logo

Android™ Tablet Application Development For Dummies® by Donn Felker

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

Identifying Your Intent

Though some applications require only a couple of screens (such as the Task Reminder application which requires a way to view the task and edit a task), a lot can be happening behind the scenes. One such notable interaction is the introduction of new screens as the user uses various features of the application. As with any application with a rich feature set, the user can interact with each screen independently. Therefore the big question arises: “How do I open another screen?”

Screen interaction is handled through Android's intent system. I have covered the intent system in detail in Chapter 8, but I have not covered an example of how to navigate from one screen to the next using an intent. Thankfully, it's a simple process — and I bet you're happy about that!

Starting new activities with intents

Activities are initiated through the Android intent framework. An Intent is a class that represents a message that is placed on the Android intent system (similar to a message-bus type of architecture), and whoever can respond to the intent lets the Android platform know, resulting in either an activity starting or a list appearing of applications to choose from (this is known as a chooser, explained shortly). One of the best ways to think of an intent is to think of it as an abstract description of an operation. (For more on intents, refer to Chapter 8.)

Starting a particular activity is easy. In your ReminderListActivity, type the following code into the onListItemClick() ...

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