Skip to content

Android Intents

January 25, 2015

Intent

Intent is data structure that specifies the description of an action to be performed. It is a message to request an action from another app component. Android uses the information contained in Intent object to specify which component to launch. Intent objects provide information about an action to be taken and the data necessary for launching that action.

Different Forms of Intent

1. Explicit Intents

Explicit intents are used where you know exactly the class name of activity or service to start.

Example:

If you want to launch the activity represented by the class say OurActiviy.class, you can launch this activity by using the following statement:
startActivity(new Intent(this,OurActiviy.class));  //read more about startActivity()

The above statement is valid only when the activity you want to launch is within the same android project as your current activity in which you are using the above statement.

2. Implicit Intents

If you want a action to be performed by the component from another app, you have to use implicit intent.

Advertisements

From → Uncategorized

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: