Added in API level 20
Notification.WearableExtender
public
static
final
class
Notification.WearableExtender
extends Object
implements
Notification.Extender
| java.lang.Object | |
| ↳ | android.app.Notification.WearableExtender |
Helper class to add wearable extensions to notifications.
See Creating Notifications for Android Wear for more information on how to use this class.
To create a notification with wearable extensions:
- Create a
Notification.Builder, setting any desired properties. - Create a
Notification.WearableExtender. - Set wearable-specific properties using the
addandsetmethods ofNotification.WearableExtender. - Call
Notification.Builder.extend(Extender)to apply the extensions to a notification. - Post the notification to the notification system with the
NotificationManager.notify(...)methods.
Notification notif = new Notification.Builder(mContext)
.setContentTitle("New mail from " + sender.toString())
.setContentText(subject)
.setSmallIcon(R.drawable.new_mail)
.extend(new Notification.WearableExtender()
.setContentIcon(R.drawable.new_mail))
.build();
NotificationManager notificationManger =
(NotificationManager) getSystemService(Context.