# 3.1 Activities

In the previous chapter, we mentioned how each activity consists of a layout file controlling the design and a class file to help with the logic behind all the different GUI elements. So far in our application we’ve only been working with one `Activity` class, but an application can have several!

Let’s see an example of this in action with Eatery.&#x20;

![MainActivity (1) and CampusMenuActivity (2)](https://195521982-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LvOeSx5ZqjJA8sxykMu%2F-Lv_8l6DA7rFApJy3oar%2F-Lv_AIpRDpcnysFYStJu%2Fimage.png?alt=media\&token=09e35c90-789e-46bf-8768-d1cc21fd1df8)

The two different screens displayed here are each their own activities in the codebase. When the user clicks an Eatery card in `MainActivity`, we say we launch the second activity. In the `onCreate()` method of the second activity, we populate the `TextView` and wait times chart with the appropriate values. When the user clicks the back button in the second activity, then we say that the second activity has **finished**, and the display returns to `MainActivity` (which is the last unfinished activity).

## A Deeper Look

Returning to our project with the single `MainActivity` class, we can see that `MainActivity` extends `AppCompatActivity`, which is a built-in class that extends `android.app.activity`.&#x20;

This tells us that `MainActivity` is of type `Activity`, and so all of the `Activity` class methods become available for the programmer, including `setContentView()` and the overridden method `onCreate()`.
