A computer is a machine that follows a list of instructions called a program. An Android device is a computer and an app is a program. Inside the device are containers called variables that hold values such as numbers or pieces of text.
A big variable that can contain smaller variables is called an object. An object can also have lists of instructions attached to it — in effect, little programs — called methods. When we execute the instructions of a method, we say that we are calling the method.
There are many classes of objects, and one class is named Activity. When an app is launched, an object of this class is automatically created, and then one of the object’s methods, named onCreate, is called. The instructions of this method tell the device to create and display a user interface for the app. This interface consists of areas on the screen that display information, and touch-sensitive areas such as buttons.
Other methods of this Activity object are called automatically when the user interface of this app is covered by another app, for example when the phone starts ringing. A final method, onDestroy, is called when the app’s user interface is no longer needed and can be destroyed. onCreate is the first of these lifecycle methods of the Activity object.