diff --git a/docs/html/guide/components/intents-common.jd b/docs/html/guide/components/intents-common.jd index 9488f6ecb9822..e6c9fc691cbb7 100644 --- a/docs/html/guide/components/intents-common.jd +++ b/docs/html/guide/components/intents-common.jd @@ -99,7 +99,6 @@ page.tags="IntentFilter"
An intent allows you to start an activity in another app by describing a simple -action you'd like to perform (such as "view a map" or "take a picture") -in an {@link android.content.Intent} object. This type of intent is -called an implicit intent because it does not specify the app component -to start, but instead specifies an action and provides some -data with which to perform the action.
++ An intent allows you to start an activity in another app by describing a + simple action you'd like to perform (such as "view a map" or "take a + picture") in an {@link android.content.Intent} object. This type of intent + is called an implicit intent because it does not specify the app + component to start, but instead specifies an action and provides + some data with which to perform the action. +
-When you call -{@link android.content.Context#startActivity startActivity()} or -{@link android.app.Activity#startActivityForResult startActivityForResult()} and pass it an -implicit intent, the system resolves the intent to an app that can handle the intent -and starts its corresponding {@link android.app.Activity}. If there's more than one app -that can handle the intent, the system presents the user with a dialog to pick which app -to use.
++ When you call {@link android.content.Context#startActivity startActivity()} + or {@link android.app.Activity#startActivityForResult + startActivityForResult()} and pass it an implicit intent, the system + resolves + the intent to an app that can handle the intent and starts its + corresponding {@link android.app.Activity}. If there's more than one app + that can handle the intent, the system presents the user with a dialog to + pick which app to use. +
-This page describes several implicit intents that you can use to perform common actions, -organized by the type of app that handles the intent. Each section also shows how you can -create an intent filter to -advertise your app's ability to perform the same action.
- -Caution: If there are no apps on the device that can receive -the implicit intent, your app will crash when it calls {@link android.content.Context#startActivity -startActivity()}. To first verify that an app exists to receive the intent, call {@link -android.content.Intent#resolveActivity resolveActivity()} on your {@link android.content.Intent} -object. If the result is non-null, there is at least one app that can handle the intent and -it's safe to call {@link android.content.Context#startActivity startActivity()}. If the result is -null, you should not use the intent and, if possible, you should disable the feature that invokes -the intent.
- -If you're not familiar with how to create intents or intent filters, you should first read -Intents and Intent Filters.
- -To learn how to fire the intents listed on this page from your development host, see -Verify Intents with the Android Debug Bridge.
- -Google Now fires some of the intents listed -on this page in response to voice commands. For more information, see -Intents Fired by Google Now.
++ This page describes several implicit intents that you can use to perform + common actions, organized by the type of app that handles the intent. Each + section also shows how you can create an intent + filter to advertise your app's ability to perform the same action. +
++ Caution: If there are no apps on the device that can + receive the implicit intent, your app will crash when it calls {@link + android.content.Context#startActivity startActivity()}. To first verify that + an app exists to receive the intent, call {@link + android.content.Intent#resolveActivity resolveActivity()} on your {@link + android.content.Intent} object. If the result is non-null, there is at least + one app that can handle the intent and it's safe to call {@link + android.content.Context#startActivity startActivity()}. If the result is + null, you should not use the intent and, if possible, you should disable the + feature that invokes the intent. +
++ If you're not familiar with how to create intents or intent filters, you + should first read Intents and Intent + Filters. +
++ To learn how to fire the intents listed on this page from your development + host, see Verify Intents with the Android Debug + Bridge. +
++ Google Voice + Actions fires some of the intents listed on this page in response to + voice commands. For more information, see + Intents fired by Google Voice Actions. +
Google Now
+ ++ Google Voice Actions +
+Google Now
+ ++ Google Voice Actions +
+To create a countdown timer, use the {@link android.provider.AlarmClock#ACTION_SET_TIMER} -action and specify timer details such as the duration using extras defined below.
++ To create a countdown timer, use the {@link + android.provider.AlarmClock#ACTION_SET_TIMER} action and specify timer + details such as the duration using extras defined below. +
Note: This intent was added in Android 4.4 (API level 19).
@@ -594,28 +622,36 @@ how to create an appropriate {@link android.net.Uri} for the output location, re </activity> -When handling this intent, your activity should check for the {@link
-android.provider.MediaStore#EXTRA_OUTPUT} extra in the incoming {@link android.content.Intent},
-then save the captured image or video at the location specified by that extra and call {@link
-android.app.Activity#setResult(int,Intent) setResult()} with an
-{@link android.content.Intent} that includes a compressed thumbnail
-in an extra named "data".
+ When handling this intent, your activity should check for the {@link
+ android.provider.MediaStore#EXTRA_OUTPUT} extra in the incoming {@link
+ android.content.Intent}, then save the captured image or video at the
+ location specified by that extra and call {@link
+ android.app.Activity#setResult(int,Intent) setResult()} with an {@link
+ android.content.Intent} that includes a compressed thumbnail in an extra
+ named "data".
+
Google Now
+ ++ Google Voice Actions +
+(Android Wear only)
+ ++ (Android Wear only) +
To call a taxi, use the @@ -1548,17 +1599,22 @@ public void playMedia(Uri file) {
Google Now
+ ++ Google Voice Actions +
+Google Now
+ ++ Google Voice Actions +
+Google Now
+ ++ Google Voice Actions +
+SEARCH_ACTION action, as shown in the example intent filter bel
"com.google.android.gms.actions.SEARCH_ACTION"For more information, see -ADB Shell Commands.
- - - - - - -Google Now recognizes many voice commands -and fires intents for them. As such, users may launch your app with a Google Now voice command -if your app declares the corresponding intent filter. For example, if your app can -set an alarm and you add the corresponding intent filter to your -manifest file, Google Now lets users choose your app when they request to set an alarm, as -shown in figure 1.
- -
-Figure 1. Google Now lets users choose from installed -apps that support a given action.
- -Google Now recognizes voice commands for the actions listed in table 1. For more information -about declaring each intent filter, click on the action description.
- -Table 1. Voice commands recognized by Google Now -(Google Search app v3.6).
-| Category | -Details and Examples | -Action Name | -
|---|---|---|
| Alarm | -
-
-
|
- {@link android.provider.AlarmClock#ACTION_SET_ALARM AlarmClock.ACTION_SET_ALARM} | -
-
-
|
- {@link android.provider.AlarmClock#ACTION_SET_TIMER AlarmClock.ACTION_SET_TIMER} | -|
| Communication | -
-
-
|
- {@link android.content.Intent#ACTION_CALL Intent.ACTION_CALL} | -
| Local | -
-
-
|
-
- ReserveIntents |
-
| Media | -
-
-
|
- {@link android.provider.MediaStore#INTENT_ACTION_MEDIA_PLAY_FROM_SEARCH MediaStore .INTENT_ACTION_MEDIA_PLAY_FROM_SEARCH} |
-
-
-
|
- {@link android.provider.MediaStore#INTENT_ACTION_STILL_IMAGE_CAMERA MediaStore .INTENT_ACTION_STILL_IMAGE_CAMERA} |
-|
-
-
|
- {@link android.provider.MediaStore#INTENT_ACTION_VIDEO_CAMERA MediaStore .INTENT_ACTION_VIDEO_CAMERA} |
-|
| Search | -
-
-
|
- "com.google.android.gms.actions |
-
| Web browser | -
-
-
|
- {@link android.content.Intent#ACTION_VIEW Intent.ACTION_VIEW} | -