Notification Notification Class

Definition

A class that represents how a persistent notification is to be presented to the user using the NotificationManager.

[Android.Runtime.Register("android/app/Notification", ApiSince=1, DoNotGenerateAcw=true)]
public class Notification : Java.Lang.Object, Android.OS.IParcelable, IDisposable
type Notification = class
    inherit Object
    interface IParcelable
    interface IJavaObject
    interface IDisposable
Inheritance
NotificationNotification
Derived
Attributes
Implements

Remarks

Android platform documentation

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() Notification()

Constructs a Notification object with default values.

Notification(Int32, ICharSequence) Notification(Int32, ICharSequence)

Constructs a Notification object with the information needed to have a status bar icon without the standard expanded view.

Notification(Int32, ICharSequence, Int64) Notification(Int32, ICharSequence, Int64)

Constructs a Notification object with the information needed to have a status bar icon without the standard expanded view.

Notification(Int32, String) Notification(Int32, String)

Constructs a Notification object with the information needed to have a status bar icon without the standard expanded view.

Notification(Int32, String, Int64) Notification(Int32, String, Int64)

Constructs a Notification object with the information needed to have a status bar icon without the standard expanded view.

Notification(IntPtr, JniHandleOwnership) Notification(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

Notification(Parcel) Notification(Parcel)

Unflatten the notification from a parcel.

Fields

CategoryAlarm CategoryAlarm

Notification category: alarm or timer.

CategoryCall CategoryCall

Notification category: incoming call (voice or video) or similar synchronous communication request.

CategoryEmail CategoryEmail

Notification category: asynchronous bulk message (email).

CategoryError CategoryError

Notification category: error in background operation or authentication status.

CategoryEvent CategoryEvent

Notification category: calendar event.

CategoryMessage CategoryMessage

Notification category: incoming direct message (SMS, instant message, etc.

CategoryProgress CategoryProgress

Notification category: progress of a long-running background operation.

CategoryPromo CategoryPromo

Notification category: promotion or advertisement.

CategoryRecommendation CategoryRecommendation

Notification category: a specific, timely recommendation for a single thing.

CategoryReminder CategoryReminder
CategoryService CategoryService

Notification category: indication of running background service.

CategorySocial CategorySocial

Notification category: social network or sharing update.

CategoryStatus CategoryStatus

Notification category: ongoing information about device or contextual status.

CategorySystem CategorySystem

Notification category: system or device status update.

CategoryTransport CategoryTransport

Notification category: media transport control for playback.

ColorDefault ColorDefault

Special value of Color telling the system not to decorate this notification with any special color but instead use default colors when presenting this notification.

ExtraAudioContentsUri ExtraAudioContentsUri
ExtraBackgroundImageUri ExtraBackgroundImageUri

Extras key: A ContentUris pointing to an image that can be displayed in the background when the notification is selected.

ExtraBigText ExtraBigText

Extras key: this is the longer text shown in the big form of a Notification.BigTextStyle notification, as supplied to Notification BigTextStyle bigText(java lang CharSequence).

ExtraChannelId ExtraChannelId
ExtraChronometerCountDown ExtraChronometerCountDown
ExtraColorized ExtraColorized
ExtraCompactActions ExtraCompactActions

Extras key: the indices of actions to be shown in the compact view, as supplied to (e.g.

ExtraConversationTitle ExtraConversationTitle
ExtraHistoricMessages ExtraHistoricMessages
ExtraInfoText ExtraInfoText

Extras key: this is a small piece of additional text as supplied to Notification Builder setContentInfo(java lang CharSequence).

ExtraLargeIcon ExtraLargeIcon

Extras key: this is a bitmap to be used instead of the small icon when showing the notification payload, as supplied to Notification Builder setLargeIcon(android graphics Bitmap).

ExtraLargeIconBig ExtraLargeIconBig
ExtraMediaSession ExtraMediaSession

Extras key: A MediaSession.Token associated with a Notification.MediaStyle notification.

ExtraMessages ExtraMessages
ExtraNotificationId ExtraNotificationId
ExtraNotificationTag ExtraNotificationTag
ExtraPeople ExtraPeople

Extras key: A String array containing the people that this notification relates to, each of which was supplied to Notification Builder addPerson(java lang String).

ExtraPicture ExtraPicture

Extras key: this is a bitmap to be shown in Notification.BigPictureStyle expanded notifications, supplied to Notification BigPictureStyle bigPicture(android graphics Bitmap).

ExtraProgress ExtraProgress

Extras key: this is the progress value supplied to Notification Builder setProgress(int,int,boolean).

ExtraProgressIndeterminate ExtraProgressIndeterminate

Extras key: whether the progress bar is indeterminate, supplied to Notification Builder setProgress(int,int,boolean).

ExtraProgressMax ExtraProgressMax

Extras key: this is the maximum value supplied to Notification Builder setProgress(int,int,boolean).

ExtraRemoteInputHistory ExtraRemoteInputHistory
ExtraSelfDisplayName ExtraSelfDisplayName
ExtraShowChronometer ExtraShowChronometer

Extras key: whether When should be shown as a count-up timer (specifically a Chronometer) instead of a timestamp, as supplied to Notification Builder setUsesChronometer(boolean).

ExtraShowWhen ExtraShowWhen

Extras key: whether When should be shown, as supplied to Notification Builder setShowWhen(boolean).

ExtraSmallIcon ExtraSmallIcon

Extras key: this is the resource ID of the notification's main small icon, as supplied to Notification Builder setSmallIcon(int).

ExtraSubText ExtraSubText

Extras key: this is a third line of text, as supplied to Notification Builder setSubText(java lang CharSequence).

ExtraSummaryText ExtraSummaryText

Extras key: this is a line of summary information intended to be shown alongside expanded notifications, as supplied to (e.g.

ExtraTemplate ExtraTemplate

Extras key: A string representing the name of the specific Notification.Style used to create this notification.

ExtraText ExtraText

Extras key: this is the main text payload, as supplied to Notification Builder setContentText(java lang CharSequence).

ExtraTextLines ExtraTextLines

Extras key: An array of CharSequences to show in Notification.InboxStyle expanded notifications, each of which was supplied to Notification InboxStyle addLine(java lang CharSequence).

ExtraTitle ExtraTitle

Extras key: this is the title of the notification, as supplied to Notification Builder setContentTitle(java lang CharSequence).

ExtraTitleBig ExtraTitleBig

Extras key: this is the title of the notification when shown in expanded form, e.g. as supplied to Notification BigTextStyle setBigContentTitle(java lang CharSequence).

IntentCategoryNotificationPreferences IntentCategoryNotificationPreferences

An activity that provides a user interface for adjusting notification preferences for its containing application.

PriorityDefault PriorityDefault

Default notification Priority.

PriorityHigh PriorityHigh

Higher Priority, for more important notifications or alerts.

PriorityLow PriorityLow

Lower Priority, for items that are less important.

PriorityMax PriorityMax

Highest Priority, for your application's most important items that require the user's prompt attention or input.

PriorityMin PriorityMin

Lowest Priority; these items might not be shown to the user except under special circumstances, such as detailed notification logs.

Properties

Actions Actions

Array of all Notification.Action structures attached to this notification by Notification Builder addAction(int,java lang CharSequence,android app PendingIntent).

AudioAttributes AudioAttributes

The AudioAttributes to use when playing the sound.

AudioAttributesDefault AudioAttributesDefault

The default value of AudioAttributes.

AudioStreamType AudioStreamType

The audio stream type to use when playing the sound.

BadgeIconType BadgeIconType
BigContentView BigContentView

A large-format version of ContentView, giving the Notification an opportunity to show more detail.

Category Category

One of the predefined notification categories (see the CATEGORY_* constants) that best describes this Notification.

ChannelId ChannelId
Class Class

Returns the unique instance of Class that represents this object's class.

(Inherited from Object)
Color Color

T:Android.Graphics._Color

ContentIntent ContentIntent

The intent to execute when the expanded status entry is clicked.

ContentView ContentView

The view that will represent this notification in the expanded status bar.

Creator Creator

Parcelable.

Defaults Defaults

Specifies which values should be taken from the defaults.

DeleteIntent DeleteIntent

The intent to execute when the notification is explicitly dismissed by the user, either with the "Clear All" button or by swiping it away individually.

Extras Extras

Additional semantic data to be carried around with this Notification.

Flags Flags
FullScreenIntent FullScreenIntent

An intent to launch instead of posting the notification to the status bar.

Group Group

Get the key used to group this notification into a cluster or stack with other notifications on devices which support such rendering.

GroupAlertBehavior GroupAlertBehavior
Handle Handle

The handle to the underlying Android instance.

(Inherited from Object)
HeadsUpContentView HeadsUpContentView

A medium-format version of ContentView, providing the Notification an opportunity to add action buttons to contentView.

Icon Icon

The resource id of a drawable to use as the icon in the status bar.

IconLevel IconLevel

If the icon in the status bar is to have more than one level, you can set this.

IJavaObjectEx.IsProxy IJavaObjectEx.IsProxy Inherited from Object
IJavaObjectEx.KeyHandle IJavaObjectEx.KeyHandle Inherited from Object
IJavaObjectEx.NeedsActivation IJavaObjectEx.NeedsActivation Inherited from Object
IJavaPeerable.JniManagedPeerState IJavaPeerable.JniManagedPeerState Inherited from Object
JniIdentityHashCode JniIdentityHashCode Inherited from Object
JniPeerMembers JniPeerMembers
LargeIcon LargeIcon

A large bitmap to be shown in the notification content area.

LedARGB LedARGB

The color of the led.

LedOffMS LedOffMS

The number of milliseconds for the LED to be off while it's flashing.

LedOnMS LedOnMS

The number of milliseconds for the LED to be on while it's flashing.

Number Number

The number of events that this notification represents.

PeerReference PeerReference Inherited from Object
Priority Priority

Relative priority for this notification.

PublicVersion PublicVersion

Replacement version of this notification whose content will be shown in an insecure context such as atop a secure keyguard.

SettingsText SettingsText
SettingsTextFormatted SettingsTextFormatted
ShortcutId ShortcutId
SmallIcon SmallIcon
SortKey SortKey

Get a sort key that orders this notification among other notifications from the same package.

Sound Sound

The sound to play.

ThresholdClass ThresholdClass

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

ThresholdType ThresholdType

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

TickerText TickerText

Text that summarizes this notification for accessibility services.

TickerView TickerView

Formerly, a view showing the TickerText.

TimeoutAfter TimeoutAfter
Vibrate Vibrate

The pattern with which to vibrate.

Visibility Visibility

Sphere of visibility of this notification, which affects how and when the SystemUI reveals the notification's presence and contents in untrusted situations (namely, on the secure lockscreen).

When When

A timestamp related to this notification, in milliseconds since the epoch.

Methods

Clone() Clone()

Creates and returns a copy of this Object.

DescribeContents() DescribeContents()

Describe the kinds of special objects contained in this Parcelable's marshalled representation.

Dispose() Dispose() Inherited from Object
Dispose(Boolean) Dispose(Boolean) Inherited from Object
Equals(Object) Equals(Object)

Compares this instance with the specified object and indicates if they are equal.

(Inherited from Object)
GetHashCode() GetHashCode()

Returns an integer hash code for this object.

(Inherited from Object)
GetLargeIcon() GetLargeIcon()
JavaFinalize() JavaFinalize()

Invoked when the garbage collector has detected that this instance is no longer reachable.

(Inherited from Object)
Notify() Notify()

Causes a thread which is waiting on this object's monitor (by means of calling one of the wait() methods) to be woken up.

(Inherited from Object)
NotifyAll() NotifyAll()

Causes all threads which are waiting on this object's monitor (by means of calling one of the wait() methods) to be woken up.

(Inherited from Object)
SetHandle(IntPtr, JniHandleOwnership) SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
SetLatestEventInfo(Context, ICharSequence, ICharSequence, PendingIntent) SetLatestEventInfo(Context, ICharSequence, ICharSequence, PendingIntent)

P:Android.App.Notification.ContentView)

SetLatestEventInfo(Context, String, String, PendingIntent) SetLatestEventInfo(Context, String, String, PendingIntent)

Sets the ContentView property to be a view with the standard "Latest Event" layout. Uses the Icon and When fields to set the icon and time fields in the view.

ToArray<T>() ToArray<T>() Inherited from Object
ToString() ToString()

Returns a string containing a concise, human-readable description of this object.

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

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.

(Inherited from Object)
Wait(Int64) Wait(Int64)

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the specified timeout expires.

(Inherited from Object)
Wait(Int64, Int32) Wait(Int64, Int32)

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the specified timeout expires.

(Inherited from Object)
WriteToParcel(Parcel, ParcelableWriteFlags) WriteToParcel(Parcel, ParcelableWriteFlags)

Flatten this notification into a parcel.

Explicit Interface Implementations

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

Extension Methods

JavaCast<TResult>(IJavaObject) JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject) JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable) GetJniTypeName(IJavaPeerable)

Applies to