Intent

A component that is used to navigate between activities.

Examples

Basic Examples

Start a Activity

A basic activity starting.

This is not closing the activity that was started previously.

Start a Activity and close the previous one

Starts a Activity then closes the previous one

This will close the Activity that was started previously.

Blocks

setData

Used to point to the location of a data object (like a file for example), while putExtra adds simple data types (such as an SMS text string for example).

setData

setScreen

Sets the screen to navigate to.

setScreen

putExtra

Pass data to another Activity. After you pass the data, you retrieve the data using the Activity getExtra key [] block.

putExtra

setFlags

Change the behavior of an activity.

  1. SINGLE_TOP — Organizes the views in a way that if the view you’re about to transition to was already called before, it would bring that view to the top rather than putting another copy on the top.

  2. CLEAR_TOP - Clears all the previous views.

setFlags

startActivity

Start a new activity.

startActivity

Last updated

Was this helpful?