Activity class is designed to handle a single task that the user can perform. Activities almost always have a visible component that allows the user to interact with the activity to perform the task. The
Activity class is not directly instantiated in an Android app. Rather, it is subclassed for every activity that the user needs to perform in the app. These subclasses are stored as
.java files in the app project’s
src folder. This allows developers to inherit all the functionality of the
Activity class and add their own unique functionality through Java code. One of the most important inherited functions of the
Activity class is the capability to respond to life cycle events such as
onPause (refer to Chapter ...