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

Start new activities with intents - Android Tutorial

From the course: Android Development Essential Training: Your First App with Kotlin

Start my 1-month free trial

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