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

Understanding Activities

In Android, the building blocks of applications are activities, so before you start banging out bits and bytes, you need a firm understanding of what activities are and how they work. An activity is a single, focused thing a user can do or interact with in an application. For example, when an app presents a list of menu items the user can choose from, that's an activity. When an app displays photographs along with their captions, that's also an activity. An application may consist of just one activity, or like most applications in the Android system, it may contain several. Though activities may work together to appear to be one cohesive application, they are actually independent of each other. An activity in Android is an important part of an application's overall life cycle, and the way the activities are launched and put together is a fundamental part of the Android's application model.

In Android, each activity is implemented as an implementation of the Activity base class. Almost all activities interact with the user, so the Activity class takes care of creating the window for you in which you can place your user interface (UI). Activities are most often presented in full-screen mode, but in some instances, you can find activities floating in windows or embedded inside other activities — this is known as an activity group.

Working with stacks and states

Activities in the system are managed as an activity stack. As users work with a tablet, they move ...

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