An activity is a single, focused action that a user can take. For example, an activity might present a list of menu items that a user can choose from, or it might display photographs along with captions. An application may consist of only one activity or (like most applications in the Android system) several. Though activities may work together to appear to be one cohesive application, they work independently from each other.
Almost all activities interact with the user, so the
Activity class creates for you the window 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 an activity floating in a window or embedded inside another activity — known as an activity group.
Working with methods, stacks, and states
Two important methods that almost all activities implement are
onCreate: Where the activity is initialized. Most importantly, it’s where you tell the activity which layout to use by using a layout ...