It is used to Start an Activity Start a Service Deliver a Broadcast Intent Types Explicit Intent Implicit Intent Explicit Intents Specify the component to start by name fully quailed ID: 546035
Download Presentation The PPT/PDF document "Intents" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
Slide1
Intents
It
is used to
Start an Activity
Start a Service
Deliver a
BroadcastSlide2
Intent Types
Explicit Intent
Implicit IntentSlide3
Explicit Intents
Specify the component to start by name (fully
quailed
name
)
Typically used to start activities within the
same application
or to start a service in response to
user
interaction
When you create an explicit intent to start an activity
or service
, the system immediately starts the app
component
specied
in the Intent objectSlide4
Implicit Intents
Do
not specify a
specic
component but instead declare
a
general
action to perform
The system
figures
out the
appropiate
app/activity
to
handle
it
For example, opening Google Maps to show the
location
from
your
app or Share or Phone.Slide5
Resolution of Implicit Intents
Activity A creates an Intent with an action description
and
passes
it to
startActivity
().
The Android System searches all apps for an intent
filter that matches
the intent. When a match is foundThe system starts the matching activity (Activity B) by invoking its onCreate() method and passing it the IntentSlide6
Building an Intent
Component
Name
The name of the component to
start.
Critical
for Explicit
Intents
Action
A string that species the generic action to perform (such as view or pick)Data The
URI object that references the data to
be acted
on and/or the MIME type of that
data
Category
A string containing additional information
about the
kind of component that should handle
the
intent
Extras
Key-value pairs that carry additional
information required
to accomplish the requested
action
Flags
Flags
defined
in the Intent class that
function as
metadata for the intentSlide7
Questions ?