3.3.2. Activity Lifecycle Methods

Throughout its life, an Activity can be in one of several statesactive (i.e., running), paused or stopped. The Activity transitions between these states in response to various events:

• An active Activity is visible on the screen and “has the focus”—that is, it’s in the foreground. This is the Activity the user is interacting with.

• A paused Activity is visible on the screen but does not have the focus—such as when an alert dialog is displayed.

• A stopped activity is not visible on the screen and is likely to be killed by the system when its memory is needed. An Activity is stopped when another Activity becomes active.

As an Activity transitions among these states, the Android runtime calls various Activity ...

Get Android™ How to Program, 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.