Android Programming: The Big Nerd Ranch Guide, 5th Edition
by Bryan Sills, Brian Gardner, Kristin Marsicano, Chris Stewart
Starting an Activity
The simplest way one activity can start another is with the startActivity(Intent) function.
If you are coming from other programming languages and platforms, your first instinct might be to call the constructor on the activity you want to start. Unfortunately, that will not work. Instead you have to call startActivity(Intent), and the OS will manage creating your activity for you.
In particular, your call is sent to a part of the OS called the ActivityManager. The ActivityManager then creates the Activity instance and calls its onCreate(Bundle?) function, as shown in Figure 7.6.
Figure 7.6 Starting an activity
How does the ActivityManager know which Activity to start? That information is in ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access