Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learning Android Application Development

You're reading from   Learning Android Application Development Start building for the world's most popular mobile platform

Arrow left icon
Product type Paperback
Published in Aug 2016
Publisher Packt
ISBN-13 9781785286117
Length 320 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
Raimon Ràfols Montane Raimon Ràfols Montane
Author Profile Icon Raimon Ràfols Montane
Raimon Ràfols Montane
Laurence Dawson Laurence Dawson
Author Profile Icon Laurence Dawson
Laurence Dawson
Arrow right icon
View More author details
Toc

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...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image