다음을 통해 공유


Notification.WearableExtender Class

Definition

Helper class to add wearable extensions to notifications.

[Android.Runtime.Register("android/app/Notification$WearableExtender", DoNotGenerateAcw=true)]
public sealed class Notification.WearableExtender : Java.Lang.Object, Android.App.Notification.IExtender, IDisposable, Java.Interop.IJavaPeerable
[<Android.Runtime.Register("android/app/Notification$WearableExtender", DoNotGenerateAcw=true)>]
type Notification.WearableExtender = class
    inherit Object
    interface Notification.IExtender
    interface IJavaObject
    interface IDisposable
    interface IJavaPeerable
Inheritance
Notification.WearableExtender
Attributes
Implements

Remarks

Helper class to add wearable extensions to notifications. <p class="note"> See Creating Notifications for Android Wear for more information on how to use this class.

To create a notification with wearable extensions: <ol> <li>Create a android.app.Notification.Builder, setting any desired properties. <li>Create a android.app.Notification.WearableExtender. <li>Set wearable-specific properties using the add and set methods of android.app.Notification.WearableExtender. <li>Call android.app.Notification.Builder#extend to apply the extensions to a notification. <li>Post the notification to the notification system with the NotificationManager.notify(...) methods. </ol>

Notification notif = new Notification.Builder(mContext)
                    .setContentTitle(&quot;New mail from &quot; + sender.toString())
                    .setContentText(subject)
                    .setSmallIcon(R.drawable.new_mail)
                    .extend(new Notification.WearableExtender()
                            .setContentIcon(R.drawable.new_mail))
                    .build();
            NotificationManager notificationManger =
                    (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
            notificationManger.notify(0, notif);

Wearable extensions can be accessed on an existing notification by using the WearableExtender(Notification) constructor, and then using the get methods to access values.

Notification.WearableExtender wearableExtender = new Notification.WearableExtender(
                    notification);
            List&lt;Notification&gt; pages = wearableExtender.getPages();

Java documentation for android.app.Notification.WearableExtender.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Constructors

Notification.WearableExtender()

Create a android.app.Notification.WearableExtender with default options.

Notification.WearableExtender(Notification)

Fields

ScreenTimeoutLong

Sentinel value for use with #setHintScreenTimeout to keep the screen on for a longer amount of time when this notification is displayed on the screen.

ScreenTimeoutShort

Sentinel value for use with #setHintScreenTimeout to keep the screen on for a short amount of time when this notification is displayed on the screen.

UnsetActionIndex

Sentinel value for an action index that is unset.

Properties

Actions

Get the wearable actions present on this notification.

Background

Get a background image to be displayed behind the notification content.

BridgeTag

Returns the bridge tag of the notification.

Class

Returns the runtime class of this Object.

(Inherited from Object)
ContentAction

Get the index of the notification action, if any, that was specified as the primary action.

ContentIcon

Get an icon that goes with the content of this notification.

ContentIconGravity

Get the gravity that the content icon should have within the notification display.

ContentIntentAvailableOffline

Get whether the content intent is available when the wearable device is not connected to a companion device.

CustomContentHeight

Get the custom height in pixels for the display of this notification's content.

CustomSizePreset

Get the custom size preset for the display of this notification out of the available presets found in android.app.Notification.WearableExtender, e.

DismissalId

Returns the dismissal id of the notification.

DisplayIntent

Get the intent to launch inside of an activity view when displaying this notification.

Gravity

Get the gravity that this notification should have within the available viewport space.

Handle

The handle to the underlying Android instance.

(Inherited from Object)
HintAmbientBigPicture

Get a hint that this notification's BigPictureStyle (if present) should be converted to low-bit and displayed in ambient mode, especially useful for barcodes and qr codes, as well as other simple black-and-white tickets.

HintAvoidBackgroundClipping

Get a hint that this notification's background should not be clipped if possible, and should instead be resized to fully display on the screen, retaining the aspect ratio of the image.

HintContentIntentLaunchesActivity

Get a hint that this notification's content intent will launch an Activity directly, telling the platform that it can generate the appropriate transitions

HintHideIcon

Get a hint that this notification's icon should not be displayed.

HintScreenTimeout

Get the duration, in milliseconds, that the screen should remain on for when this notification is displayed.

HintShowBackgroundOnly

Get a visual hint that only the background image of this notification should be displayed, and other semantic content should be hidden.

JniIdentityHashCode (Inherited from Object)
JniPeerMembers
Pages

Get the array of additional pages of content for displaying this notification.

PeerReference (Inherited from Object)
StartScrollBottom

Get whether the scrolling position for the contents of this notification should start at the bottom of the contents instead of the top when the contents are too long to display within the screen.

ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

(Inherited from Object)
ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

(Inherited from Object)

Methods

AddAction(Notification+Action)
AddActions(IList<Notification.Action>)
AddPage(Notification)
AddPages(IList<Notification>)
ClearActions()
ClearPages()
Clone()
Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
Extend(Notification+Builder)
GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
SetBackground(Bitmap)
SetBridgeTag(String)
SetContentAction(Int32)
SetContentIcon(Int32)
SetContentIconGravity(GravityFlags)
SetContentIntentAvailableOffline(Boolean)
SetCustomContentHeight(Int32)
SetCustomSizePreset(WearableSizePreset)
SetDismissalId(String)
SetDisplayIntent(PendingIntent)
SetGravity(GravityFlags)
SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
SetHintAmbientBigPicture(Boolean)
SetHintAvoidBackgroundClipping(Boolean)
SetHintContentIntentLaunchesActivity(Boolean)
SetHintHideIcon(Boolean)
SetHintScreenTimeout(Int32)
SetHintShowBackgroundOnly(Boolean)
SetStartScrollBottom(Boolean)
ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnregisterFromRuntime() (Inherited from Object)
Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to