Android: Activity

In the official Android API documentation, an activity is "defined as a single, focused thing that the user can do."

To put it simply, an activity handles interaction with the user, and acts as a controller that receives and outputs responses based on user input. An activity also acts as a bucket or container by creatying a window in which you can place your views or UI. Activities are often presented to the user as full-screen windows, but they can used in other ways such as floating windows or embedded inside of another activity.

Key points

  • An activity handles interaction with the user
  • An activity receives requests and send output
  • An activity provides the window that will contain UI/views and even another activity

Creating  a new Activity

If you are using Android Studio, you can create a new activity by right clicking on the app name in the Project path:  src > main > java and selecting "Activity"

This will also create an activity layout XML file format under the src > main >java > layout folder.