Creating activities
Now that we have gone through the essentials and covered the activity boilerplate introduction, we can actually begin to have some fun and create our first activities! In this simple example, we will cover how to launch an activity and show how to extend the Activity
super class to create an instance of our own activity. This will be a very simple introductory example and should not take more than 20-25 minutes to complete. So grab a coffee and let's get started!
Defining your activity
In the previous chapter, we introduced the Android App Manifest (AndroidManifest.xml
) that contains essential information such as the package name and components of an application. For each activity in your application, you must create a corresponding entry in the app manifest along with additional information such as theme of the activity.
Creating an entry in the manifest is easy and you will only need the name of your activity in this example. You also need to add your activities...