January 2017
Beginner to intermediate
624 pages
22h 42m
English
The simplest way one activity can start another is with the startActivity method:
public void startActivity(Intent intent)
You might guess that startActivity(Intent) is a static method that you call on the Activity subclass that you want to start. But it is not. When an activity calls startActivity(Intent), this call is sent to the OS.
In particular, it is sent to a part of the OS called the ActivityManager. The ActivityManager then creates the Activity instance and calls its onCreate(Bundle) method, as shown in Figure 5.7.
Figure 5.7 Starting an activity
Read now
Unlock full access