From the course: Android Development Essential Training: Your First App with Kotlin
Unlock the full course today
Join today to access over 22,700 courses taught by industry experts or purchase this course individually.
Start new activities with intents - Android Tutorial
From the course: Android Development Essential Training: Your First App with Kotlin
Start new activities with intents
- [Instructor] In order to navigate from one screen to another in an Android app, you'll create something called an Intent. An Intent is a set of instructions. Each Intent can include an action, typically expressed as a constant, but it can also include arbitrary data values known as extras. In order to navigate, create an Intent that references the current activity as a context, and the desired target activity's class. The application framework is responsible for interpreting the Intent. It creates an instance of the target activity's class, and then loads it, and the user just sees the new Intent screen appear. To demonstrate this, I'll create a new activity. I'll start in my Android scope and I'll right-click on the app module. I'll select new activity, and I'll choose basic activity. And I'll accept the activity name of Main2Activity. And I'll set it as a Launcher Activity. This is going to become my new primary screen. And I'll click finish. Now, when you create the new activity,…
Contents
-
-
-
-
-
-
(Locked)
Define screens with activities4m 2s
-
(Locked)
Implement designs in XML layouts3m 59s
-
(Locked)
Use the View and ViewGroup components3m 28s
-
(Locked)
Display an image in an activity4m 36s
-
Convert PNG and SVG image files3m 48s
-
(Locked)
Start new activities with intents4m 25s
-
(Locked)
Send an action to a new activity4m 32s
-
(Locked)
Send data URIs and extras with intents6m 50s
-
(Locked)
Handle shared data with an intent filter5m 39s
-
(Locked)
-