summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorScott Rowe <scottrowe@google.com>2015-01-17 01:31:52 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-01-17 01:31:53 +0000
commitc987ca05010a8cc06572d5b04c93fb6404f8bf45 (patch)
tree58005e7b5691f7cc215338c914f533cdc374b2c2 /docs
parentab18d6c82eb92732ef7ab54adffcd27faffd0c57 (diff)
parentc222198a2c8c24a9e27507bb4f4462644626a347 (diff)
downloadframeworks_base-c987ca05010a8cc06572d5b04c93fb6404f8bf45.zip
frameworks_base-c987ca05010a8cc06572d5b04c93fb6404f8bf45.tar.gz
frameworks_base-c987ca05010a8cc06572d5b04c93fb6404f8bf45.tar.bz2
Merge "docs: removing code captions" into lmp-docs
Diffstat (limited to 'docs')
-rw-r--r--docs/html/training/tv/discovery/recommendations.jd43
1 files changed, 15 insertions, 28 deletions
diff --git a/docs/html/training/tv/discovery/recommendations.jd b/docs/html/training/tv/discovery/recommendations.jd
index d348c14..a74ee56 100644
--- a/docs/html/training/tv/discovery/recommendations.jd
+++ b/docs/html/training/tv/discovery/recommendations.jd
@@ -61,11 +61,6 @@ trainingnavtop=true
create a recommendation service for your application:
</p>
-
-<p class="code-caption">
- <a href="https://github.com/googlesamples/androidtv-Leanback/blob/master/app/src/main/java/com/example/android/tvleanback/UpdateRecommendationsService.java" target="_blank">
- UpdateRecommendationsService.java</a>
-</p>
<pre>
public class UpdateRecommendationsService extends IntentService {
private static final String TAG = "UpdateRecommendationsService";
@@ -136,10 +131,6 @@ public class UpdateRecommendationsService extends IntentService {
app manifest. The following code snippet illustrates how to declare this class as a service:
</p>
-<p class="code-caption">
- <a href="https://github.com/googlesamples/androidtv-Leanback/blob/master/app/src/main/AndroidManifest.xml" target="_blank">
- AndroidManifest.xml</a>
-</p>
<pre>
&lt;manifest ... &gt;
&lt;application ... &gt;
@@ -160,6 +151,11 @@ the recommendations to appear at the end of the recommendations row. Once a cont
movie, has been played, <a href="{@docRoot}guide/topics/ui/notifiers/notifications.html#Removing">
remove it</a> from the recommendations.</p>
+<p>The order of an app's recommendations is preserved according to the order in which the app
+provides them. The framework interleaves app recommendations based on recommendation quality,
+as measured by user behavior. Better recommendations make an app's recommendations more likely
+to appear near the front of the list.</p>
+
<h2 id="build">Build Recommendations</h2>
<p>
@@ -175,10 +171,6 @@ remove it</a> from the recommendations.</p>
the builder pattern described as follows. First, you set the values of the recommendation card
elements.</p>
-<p class="code-caption">
- <a href="https://github.com/googlesamples/androidtv-Leanback/blob/master/app/src/main/java/com/example/android/tvleanback/RecommendationBuilder.java" target="_blank">
- RecommendationBuilder.java</a>
-</p>
<pre>
public class RecommendationBuilder {
...
@@ -221,13 +213,9 @@ public class RecommendationBuilder {
</p>
<p>
- The following code example demonstrates how to build a recommendation, and post it to the manager.
+ The following code example demonstrates how to build a recommendation.
</p>
-<p class="code-caption">
- <a href="https://github.com/googlesamples/androidtv-Leanback/blob/master/app/src/main/java/com/example/android/tvleanback/RecommendationBuilder.java" target="_blank">
- RecommendationBuilder.java</a>
-</p>
<pre>
public class RecommendationBuilder {
...
@@ -250,8 +238,6 @@ public class RecommendationBuilder {
.setExtras(extras))
.build();
- mNotificationManager.notify(mId, notification);
- mNotificationManager = null;
return notification;
}
}
@@ -267,10 +253,6 @@ public class RecommendationBuilder {
every half hour:
</p>
-<p class="code-caption">
- <a href="https://github.com/googlesamples/androidtv-Leanback/blob/master/app/src/main/java/com/example/android/tvleanback/BootupActivity.java" target="_blank">
- BootupActivity.java</a>
-</p>
<pre>
public class BootupActivity extends BroadcastReceiver {
private static final String TAG = "BootupActivity";
@@ -307,10 +289,6 @@ public class BootupActivity extends BroadcastReceiver {
following sample code demonstrates how to add this configuration to the manifest:
</p>
-<p class="code-caption">
- <a href="https://github.com/googlesamples/androidtv-Leanback/blob/master/app/src/main/AndroidManifest.xml" target="_blank">
- AndroidManifest.xml</a>
-</p>
<pre>
&lt;manifest ... &gt;
&lt;application ... &gt;
@@ -330,3 +308,12 @@ public class BootupActivity extends BroadcastReceiver {
requests the {@link android.Manifest.permission#RECEIVE_BOOT_COMPLETED} permission.
For more information, see {@link android.content.Intent#ACTION_BOOT_COMPLETED}.
</p>
+
+<p>In your recommendation service class' {@link android.app.IntentService#onHandleIntent(android.content.Intent)
+onHandleIntent()}
+method, post the recommendation to the manager as follows:</p>
+
+<pre>
+Notification notification = notificationBuilder.build();
+mNotificationManager.notify(id, notification);
+</pre>