Unlike many Java apps, Android apps don’t have a main
method. Instead, they have four types of executable components—activities, services, content providers and broadcast receivers. In this chapter, we’ll discuss activities, which are defined as subclasses of Activity (package android.app). Users interact with an Activity
through views—that is, GUI components. Before Android 3.0, a separate Activity
was typically associated with each screen of an app. As you’ll see, starting in Chapter 5, an Activity
can manage multiple Fragment
s. On a phone, each Fragment
typically occupies the entire screen and the Activity
switches between the Fragment
s based on user interactions. On a tablet, activities often display multiple Fragment
s per screen to take better advantage of the larger screen size.
3.23.79.149