diff options
Diffstat (limited to 'docs/html/training/wearables/notifications')
-rw-r--r-- | docs/html/training/wearables/notifications/pages.jd | 13 | ||||
-rw-r--r-- | docs/html/training/wearables/notifications/voice-input.jd | 7 |
2 files changed, 9 insertions, 11 deletions
diff --git a/docs/html/training/wearables/notifications/pages.jd b/docs/html/training/wearables/notifications/pages.jd index d74c8ea..6315037 100644 --- a/docs/html/training/wearables/notifications/pages.jd +++ b/docs/html/training/wearables/notifications/pages.jd @@ -57,15 +57,14 @@ Notification secondPageNotification = .setStyle(secondPageStyle) .build(); -// Add second page with wearable extender and extend the main notification -Notification twoPageNotification = - new WearableExtender() - .addPage(secondPageNotification) - .extend(notificationBuilder) - .build(); +// Extend the notification builder with the second page +Notification notification = notificationBuilder + .extend(new NotificationCompat.WearableExtender() + .addPage(secondPageNotification)) + .build(); // Issue the notification notificationManager = NotificationManagerCompat.from(this); -notificationManager.notify(notificationId, twoPageNotification); +notificationManager.notify(notificationId, notification); </pre>
\ No newline at end of file diff --git a/docs/html/training/wearables/notifications/voice-input.jd b/docs/html/training/wearables/notifications/voice-input.jd index 4a27826..3ce1c80 100644 --- a/docs/html/training/wearables/notifications/voice-input.jd +++ b/docs/html/training/wearables/notifications/voice-input.jd @@ -37,7 +37,7 @@ so you can type replies instead.</p> <h2 id="VoiceInput">Define the Voice Input</h2> -<p>To create an action that supports voice input, create an instance of +<p>To create an action that supports voice input, create an instance of {@link android.support.v4.app.RemoteInput.Builder} that you can add to your notification action. This class's constructor accepts a string that the system uses as the key for the voice input, which you'll later use to retrieve the text of the @@ -166,9 +166,8 @@ which is referenced by the <code>EXTRA_VOICE_REPLY</code> key that is used in th private CharSequence getMessageText(Intent intent) { Bundle remoteInput = RemoteInput.getResultsFromIntent(intent); - if (remoteInput != null) { - return remoteInput.getCharSequence(EXTRA_VOICE_REPLY); - } + if (remoteInput != null) { + return remoteInput.getCharSequence(EXTRA_VOICE_REPLY); } return null; } |