diff --git a/docs/html/guide/components/intents-common.jd b/docs/html/guide/components/intents-common.jd index ac61924e3ad63..d4b033a5f8d73 100644 --- a/docs/html/guide/components/intents-common.jd +++ b/docs/html/guide/components/intents-common.jd @@ -80,6 +80,13 @@ page.tags="IntentFilter"
Google Now
@@ -302,7 +309,8 @@ android.provider.AlarmClock#ACTION_SET_ALARM} intent, your app must have theGoogle Now
@@ -605,7 +613,8 @@ in an extra named"data".
Google Now
@@ -660,7 +669,8 @@ public void capturePhoto() {Google Now
@@ -1351,7 +1361,8 @@ Framework guide.Google Now
@@ -1362,14 +1373,21 @@ Framework guide.To track a bike ride, use the "vnd.google.fitness.TRACK" action with the
-"vnd.google.fitness.activity/biking" MIME type and set the "actionStatus"
-extra to "ActiveActionStatus" when starting and to "CompletedActionStatus"
-when stopping.
To track a bike ride, use the
+
+ACTION_TRACK action with the "vnd.google.fitness.activity/biking"
+MIME type and set the
+
+EXTRA_STATUS extra to
+
+STATUS_ACTIVE when starting and to
+
+STATUS_COMPLETED when stopping.
"vnd.google.fitness.TRACK"ACTION_TRACK"actionStatus""ActiveActionStatus" when starting and
- "CompletedActionStatus" when stopping.EXTRA_STATUSSTATUS_ACTIVE when starting and
+
+ STATUS_COMPLETED when stopping.Example intent:
public void startBikeRide() {
- Intent intent = new Intent("vnd.google.fitness.TRACK")
+ Intent intent = new Intent(FitnessIntents.ACTION_TRACK)
.setType("vnd.google.fitness.activity/biking")
- .putExtra("actionStatus", "ActiveActionStatus");
+ .putExtra(FitnessIntents.EXTRA_STATUS, FitnessIntents.STATUS_ACTIVE);
if (intent.resolveActivity(getPackageManager()) != null) {
startActivity(intent);
}
@@ -1422,7 +1443,8 @@ public void startBikeRide() {
Google Now
@@ -1433,14 +1455,21 @@ public void startBikeRide() {
-To track a run, use the "vnd.google.fitness.TRACK" action with the
-"vnd.google.fitness.activity/running" MIME type and set the "actionStatus"
-extra to "ActiveActionStatus" when starting and to "CompletedActionStatus"
-when stopping.
+To track a run, use the
+
+ACTION_TRACK action with the "vnd.google.fitness.activity/running"
+MIME type and set the
+
+EXTRA_STATUS extra to
+
+STATUS_ACTIVE when starting and to
+
+STATUS_COMPLETED when stopping.
"vnd.google.fitness.TRACK"ACTION_TRACK"actionStatus""ActiveActionStatus" when starting and
- "CompletedActionStatus" when stopping.EXTRA_STATUSSTATUS_ACTIVE when starting and
+
+ STATUS_COMPLETED when stopping.Example intent:
public void startRun() {
- Intent intent = new Intent("vnd.google.fitness.TRACK")
+ Intent intent = new Intent(FitnessIntents.ACTION_TRACK)
.setType("vnd.google.fitness.activity/running")
- .putExtra("actionStatus", "ActiveActionStatus");
+ .putExtra(FitnessIntents.EXTRA_STATUS, FitnessIntents.STATUS_ACTIVE);
if (intent.resolveActivity(getPackageManager()) != null) {
startActivity(intent);
}
@@ -1492,7 +1524,8 @@ public void startRun() {
Google Now
@@ -1503,14 +1536,21 @@ public void startRun() {
-To track a workout, use the "vnd.google.fitness.TRACK" action with the
-"vnd.google.fitness.activity/other" MIME type and set the "actionStatus"
-extra to "ActiveActionStatus" when starting and to "CompletedActionStatus"
-when stopping.
+To track a workout, use the
+
+ACTION_TRACK action with the "vnd.google.fitness.activity/other"
+MIME type and set the
+
+EXTRA_STATUS extra to
+
+STATUS_ACTIVE when starting and to
+
+STATUS_COMPLETED when stopping.
"vnd.google.fitness.TRACK"ACTION_TRACK"actionStatus""ActiveActionStatus" when starting and
- "CompletedActionStatus" when stopping.EXTRA_STATUSSTATUS_ACTIVE when starting and
+
+ STATUS_COMPLETED when stopping.Example intent:
public void startWorkout() {
- Intent intent = new Intent("vnd.google.fitness.TRACK")
+ Intent intent = new Intent(FitnessIntents.ACTION_TRACK)
.setType("vnd.google.fitness.activity/other")
- .putExtra("actionStatus", "ActiveActionStatus");
+ .putExtra(FitnessIntents.EXTRA_STATUS, FitnessIntents.STATUS_ACTIVE);
if (intent.resolveActivity(getPackageManager()) != null) {
startActivity(intent);
}
@@ -1562,7 +1605,8 @@ public void startWorkout() {
Google Now
@@ -1572,12 +1616,15 @@ public void startWorkout() {
-To show the user's heart rate, use the "vnd.google.fitness.VIEW" action with the
-"vnd.google.fitness.data_type
/com.google.heart_rate.bpm" MIME type.
+To show the user's heart rate, use the
+
+ACTION_VIEW action with the
+"vnd.google.fitness.data_type/com.google.heart_rate.bpm" MIME type.
"vnd.google.fitness.VIEW"ACTION_VIEWExample intent:
-public void showHR() {
- Intent intent = new Intent("vnd.google.fitness.VIEW")
+public void showHeartRate() {
+ Intent intent = new Intent(FitnessIntents.ACTION_VIEW)
.setType("vnd.google.fitness.data_type/com.google.heart_rate.bpm");
if (intent.resolveActivity(getPackageManager()) != null) {
startActivity(intent);
@@ -1623,7 +1670,8 @@ public void showHR() {
Google Now
@@ -1633,12 +1681,16 @@ public void showHR() {
-To show the user's step count, use the "vnd.google.fitness.VIEW" action with the
-"vnd.google.fitness.data_type
/com.google.step_count.cumulative" MIME type.
+To show the user's step count, use the
+
+ACTION_VIEW action with the
+"vnd.google.fitness.data_type
/com.google.step_count
.cumulative" MIME
+type.
"vnd.google.fitness.VIEW"ACTION_VIEWExample intent:
public void showStepCount() {
- Intent intent = new Intent("vnd.google.fitness.VIEW")
+ Intent intent = new Intent(FitnessIntents.ACTION_VIEW)
.setType("vnd.google.fitness.data_type/com.google.step_count.cumulative");
if (intent.resolveActivity(getPackageManager()) != null) {
startActivity(intent);
@@ -1689,7 +1741,8 @@ public void showStepCount() {
Google Now
@@ -1888,7 +1941,8 @@ public void playMedia(Uri file) {
Google Now
@@ -2134,7 +2188,8 @@ but the user must press the Call button to begin the phone call.
Google Now
@@ -2211,6 +2266,98 @@ public void dialPhoneNumber(String phoneNumber) {
+Search
+
+Search using a specific app
+
+
+
+
+To support search within the context of your app, declare an intent filter in your app with
+the SEARCH_ACTION action, as shown in the example intent filter below.
+
+
+- Action
+-
+
+ "com.google.android.gms.actions.SEARCH_ACTION"
+ - Support search queries from Google Now.
+
+
+
+- Extras
+-
+
+ {@link android.app.SearchManager#QUERY}
+ - A string that contains the search query.
+
+
+
+
+Example intent filter:
+
+<activity android:name=".SearchActivity">
+ <intent-filter>
+ <action android:name="com.google.android.gms.actions.SEARCH_ACTION"/>
+ <category android:name="android.intent.category.DEFAULT"/>
+ </intent-filter>
+</activity>
+
+
+
+
+Perform a web search
+
+To initiate a web search, use the {@link android.content.Intent#ACTION_WEB_SEARCH} action
+and specify the search string in the
+{@link android.app.SearchManager#QUERY SearchManager.QUERY} extra.
+
+
+
+ - Action
+ - {@link android.content.Intent#ACTION_WEB_SEARCH}
+
+ - Data URI Scheme
+ - None
+
+ - MIME Type
+ - None
+
+ - Extras
+ -
+
+ - {@link android.app.SearchManager#QUERY SearchManager.QUERY}
+ - The search string.
+
+
+
+
+Example intent:
+
+public void searchWeb(String query) {
+ Intent intent = new Intent(Intent.ACTION_SEARCH);
+ intent.putExtra(SearchManager.QUERY, query);
+ if (intent.resolveActivity(getPackageManager()) != null) {
+ startActivity(intent);
+ }
+}
+
+
+
+
+
+
+
Settings
@@ -2379,7 +2526,8 @@ at {@link android.provider.Telephony}.
Google Now
@@ -2447,46 +2595,6 @@ open your Android app instead of your web page.
-Perform a web search
-
-To initiate a web search, use the {@link android.content.Intent#ACTION_WEB_SEARCH} action
-and specify the search string in the
-{@link android.app.SearchManager#QUERY SearchManager.QUERY} extra.
-
-
-
- - Action
- - {@link android.content.Intent#ACTION_WEB_SEARCH}
-
- - Data URI Scheme
- - None
-
- - MIME Type
- - None
-
- - Extras
- -
-
- - {@link android.app.SearchManager#QUERY SearchManager.QUERY}
- - The search string.
-
-
-
-
-Example intent:
-
-public void searchWeb(String query) {
- Intent intent = new Intent(Intent.ACTION_SEARCH);
- intent.putExtra(SearchManager.QUERY, query);
- if (intent.resolveActivity(getPackageManager()) != null) {
- startActivity(intent);
- }
-}
-
-
-
-
-
@@ -2588,7 +2696,8 @@ about declaring each intent filter, click on the action description.
- "stop cycling"
- "vnd.google.fitness.TRACK"
+
+ FitnessIntents.ACTION_TRACK
@@ -2599,7 +2708,8 @@ about declaring each intent filter, click on the action description.
- "stop running"
- "vnd.google.fitness.TRACK"
+
+ FitnessIntents.ACTION_TRACK
@@ -2610,7 +2720,8 @@ about declaring each intent filter, click on the action description.
- "stop workout"
- "vnd.google.fitness.TRACK"
+
+ FitnessIntents.ACTION_TRACK
@@ -2620,7 +2731,8 @@ about declaring each intent filter, click on the action description.
- "what's my bpm"
- "vnd.google.fitness.VIEW"
+
+ FitnessIntents.ACTION_VIEW
@@ -2630,7 +2742,8 @@ about declaring each intent filter, click on the action description.
- "what's my step count"
- "vnd.google.fitness.VIEW"
+
+ FitnessIntents.ACTION_VIEW
Local
@@ -2672,6 +2785,16 @@ about declaring each intent filter, click on the action description.
{@link android.provider.MediaStore#INTENT_ACTION_VIDEO_CAMERA MediaStore
.INTENT_ACTION_VIDEO_CAMERA}
+
+ Search
+
+
+
+ - "search for cat videos
on myvideoapp"
+
+
+ "com.google.android.gms.actions
.SEARCH_ACTION"
+
Web browser