2. What is Intent in Android?
Intents are the standard messaging mechanism
in Android that express the user’s intention to
perform some work.
They allow you to interact with other
components defined by you or by the Android
Operating System.
3. Examples:
● When you send a message.
● When you start the camera.
● When you dial a phone number.
● When you start a service.
● When you lunch an activity.
4. Intents’re used in both ways
● To call a component by you.
● To notify you of some events by the system.
5. How to create an intent?
● Create the intent.
● Add intent options.
● Run the intent.
6. Pending Intent
A PendingIntent is a token that you give to a
foreign application which allows the foreign to
use you application’s permissions to execute a
predefined piece of code.
8. Other differences...
● Regular Intent : does not require pending
intent to be created
● Pending Intent : Requires a regular intent to
be created.
9. Types of Intents
TupRTypesTT
Implicit Intent that doesn’t specify the
component.
Example:
Intent intent = new Intent( Intent.ACTION_VIEW);
intent.setData(Uri.parse(“__________”));
startActivity(intent);
10. Types of Intents
Explicit intents specifies the component.
Example:
Intent i = new Intent(getApplicationContext(),
Activitytwo.class);
StartActivity(i);