Intents
Intents
INTENTS
3
EXPLICIT INTENT
An activity can announce that some event has occurred and some
component should respond to this event (mentioning some data for said
purpose)
No need to explicitly mention which component (activity/service)
should respond to this event
Examples:
Call to given number
Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:555-
2368"));
Open given URL in web browser
Intent viewIntent = new Intent("android.intent.action.VIEW", 5
Uri.parse("http://www.google.com"));
IMPLICIT VS EXPLICIT INTENTS
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
7
ACTIONS