Android Guides | Samples

Android.App.Notification Class

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

See Also: Notification

Syntax

[Android.Runtime.Register("android/app/Notification", DoNotGenerateAcw=true)]
public class Notification : Object, IParcelable, IDisposable

Remarks

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

Developer Guides

The NoType:android/app/Notification$Builder;Href=../../../reference/android/app/Notification.Builder.html has been added to make it easier to construct Notifications.

For a guide to creating notifications, read the Status Bar Notifications developer guide.

[Android Documentation]

Requirements

Namespace: Android.App
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1

The members of Android.App.Notification are listed below.

See Also: Object

Public Constructors

Constructs a Notification object with default values.
Unflatten the notification from a parcel.
Constructs a Notification object with the information needed to have a status bar icon without the standard expanded view.
Constructs a Notification object with the information needed to have a status bar icon without the standard expanded view.
Constructs a Notification object with the information needed to have a status bar icon without the standard expanded view.
Constructs a Notification object with the information needed to have a status bar icon without the standard expanded view.

Protected Constructors

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

Public Fields

const
CategoryAlarmString. Notification category: alarm or timer.
const
CategoryCallString. Notification category: incoming call (voice or video) or similar synchronous communication request.
const
CategoryEmailString. Notification category: asynchronous bulk message (email).
const
CategoryErrorString. Notification category: error in background operation or authentication status.
const
CategoryEventString. Notification category: calendar event.
const
CategoryMessageString. Notification category: incoming direct message (SMS, instant message, etc.
const
CategoryProgressString. Notification category: progress of a long-running background operation.
const
CategoryPromoString. Notification category: promotion or advertisement.
const
CategoryRecommendationString. Notification category: a specific, timely recommendation for a single thing.
const
CategoryServiceString. Notification category: indication of running background service.
const
CategorySocialString. Notification category: social network or sharing update.
const
CategoryStatusString. Notification category: ongoing information about device or contextual status.
const
CategorySystemString. Notification category: system or device status update.
const
CategoryTransportString. Notification category: media transport control for playback.
const
ColorDefaultInt32 (0). Special value of Notification.Color telling the system not to decorate this notification with any special color but instead use default colors when presenting this notification.
const
ExtraBackgroundImageUriString. Notification.Extras key: A ContentUris pointing to an image that can be displayed in the background when the notification is selected.
const
ExtraBigTextString. Notification.Extras key: this is the longer text shown in the big form of a NoType:android/app/Notification$BigTextStyle;Href=../../../reference/android/app/Notification.BigTextStyle.html notification, as supplied to NoType:android/app/Notification$BigTextStyle;Href=../../../reference/android/app/Notification.BigTextStyle.html#bigText(java.lang.CharSequence).
const
ExtraCompactActionsString. Notification.Extras key: the indices of actions to be shown in the compact view, as supplied to (e.g.
const
ExtraInfoTextString. Notification.Extras key: this is a small piece of additional text as supplied to NoType:android/app/Notification$Builder;Href=../../../reference/android/app/Notification.Builder.html#setContentInfo(java.lang.CharSequence).
const
ExtraLargeIconString. Notification.Extras key: this is a bitmap to be used instead of the small icon when showing the notification payload, as supplied to NoType:android/app/Notification$Builder;Href=../../../reference/android/app/Notification.Builder.html#setLargeIcon(android.graphics.Bitmap).
const
ExtraLargeIconBigString. Notification.Extras key: this is a bitmap to be used instead of the one from NoType:android/app/Notification$Builder;Href=../../../reference/android/app/Notification.Builder.html#setLargeIcon(android.graphics.Bitmap) when the notification is shown in its expanded form, as supplied to NoType:android/app/Notification$BigPictureStyle;Href=../../../reference/android/app/Notification.BigPictureStyle.html#bigLargeIcon(android.graphics.Bitmap).
const
ExtraMediaSessionString. Notification.Extras key: A NoType:android/media/session/MediaSession$Token;Href=../../../reference/android/media/session/MediaSession.Token.html associated with a NoType:android/app/Notification$MediaStyle;Href=../../../reference/android/app/Notification.MediaStyle.html notification.
const
ExtraPeopleString. Notification.Extras key: A String array containing the people that this notification relates to, each of which was supplied to NoType:android/app/Notification$Builder;Href=../../../reference/android/app/Notification.Builder.html#addPerson(java.lang.String).
const
ExtraPictureString. Notification.Extras key: this is a bitmap to be shown in NoType:android/app/Notification$BigPictureStyle;Href=../../../reference/android/app/Notification.BigPictureStyle.html expanded notifications, supplied to NoType:android/app/Notification$BigPictureStyle;Href=../../../reference/android/app/Notification.BigPictureStyle.html#bigPicture(android.graphics.Bitmap).
const
ExtraProgressString. Notification.Extras key: this is the progress value supplied to NoType:android/app/Notification$Builder;Href=../../../reference/android/app/Notification.Builder.html#setProgress(int, int, boolean).
const
ExtraProgressIndeterminateString. Notification.Extras key: whether the progress bar is indeterminate, supplied to NoType:android/app/Notification$Builder;Href=../../../reference/android/app/Notification.Builder.html#setProgress(int, int, boolean).
const
ExtraProgressMaxString. Notification.Extras key: this is the maximum value supplied to NoType:android/app/Notification$Builder;Href=../../../reference/android/app/Notification.Builder.html#setProgress(int, int, boolean).
const
ExtraShowChronometerString. Notification.Extras key: whether Notification.When should be shown as a count-up timer (specifically a Chronometer) instead of a timestamp, as supplied to NoType:android/app/Notification$Builder;Href=../../../reference/android/app/Notification.Builder.html#setUsesChronometer(boolean).
const
ExtraShowWhenString. Notification.Extras key: whether Notification.When should be shown, as supplied to NoType:android/app/Notification$Builder;Href=../../../reference/android/app/Notification.Builder.html#setShowWhen(boolean).
const
ExtraSmallIconString. Notification.Extras key: this is the resource ID of the notification's main small icon, as supplied to NoType:android/app/Notification$Builder;Href=../../../reference/android/app/Notification.Builder.html#setSmallIcon(int).
const
ExtraSubTextString. Notification.Extras key: this is a third line of text, as supplied to NoType:android/app/Notification$Builder;Href=../../../reference/android/app/Notification.Builder.html#setSubText(java.lang.CharSequence).
const
ExtraSummaryTextString. Notification.Extras key: this is a line of summary information intended to be shown alongside expanded notifications, as supplied to (e.g.
const
ExtraTemplateString. Notification.Extras key: A string representing the name of the specific NoType:android/app/Notification$Style;Href=../../../reference/android/app/Notification.Style.html used to create this notification.
const
ExtraTextString. Notification.Extras key: this is the main text payload, as supplied to NoType:android/app/Notification$Builder;Href=../../../reference/android/app/Notification.Builder.html#setContentText(java.lang.CharSequence).
const
ExtraTextLinesString. Notification.Extras key: An array of CharSequences to show in NoType:android/app/Notification$InboxStyle;Href=../../../reference/android/app/Notification.InboxStyle.html expanded notifications, each of which was supplied to NoType:android/app/Notification$InboxStyle;Href=../../../reference/android/app/Notification.InboxStyle.html#addLine(java.lang.CharSequence).
const
ExtraTitleString. Notification.Extras key: this is the title of the notification, as supplied to NoType:android/app/Notification$Builder;Href=../../../reference/android/app/Notification.Builder.html#setContentTitle(java.lang.CharSequence).
const
ExtraTitleBigString. Notification.Extras key: this is the title of the notification when shown in expanded form, e.g. as supplied to NoType:android/app/Notification$BigTextStyle;Href=../../../reference/android/app/Notification.BigTextStyle.html#setBigContentTitle(java.lang.CharSequence).
const
IntentCategoryNotificationPreferencesString. An activity that provides a user interface for adjusting notification preferences for its containing application.
const
PriorityDefaultNotificationPriority (0). Default notification Notification.Priority.
const
PriorityHighNotificationPriority (1). Higher Notification.Priority, for more important notifications or alerts.
const
PriorityLowNotificationPriority (-1). Lower Notification.Priority, for items that are less important.
const
PriorityMaxNotificationPriority (2). Highest Notification.Priority, for your application's most important items that require the user's prompt attention or input.
const
PriorityMinNotificationPriority (-2). Lowest Notification.Priority; these items might not be shown to the user except under special circumstances, such as detailed notification logs.

Public Properties

ActionsIList<Notification.Action>. Array of all NoType:android/app/Notification$Action;Href=../../../reference/android/app/Notification.Action.html structures attached to this notification by NoType:android/app/Notification$Builder;Href=../../../reference/android/app/Notification.Builder.html#addAction(int, java.lang.CharSequence, android.app.PendingIntent).
AudioAttributesAudioAttributes. The AudioAttributes to use when playing the sound.
[read-only]
static
AudioAttributesDefaultAudioAttributes. The default value of Notification.AudioAttributes.
AudioStreamTypeStream. The audio stream type to use when playing the sound.
BigContentViewRemoteViews. A large-format version of Notification.ContentView, giving the Notification an opportunity to show more detail.
CategoryString. One of the predefined notification categories (see the CATEGORY_* constants) that best describes this Notification.
ColorColor. Accent color (an ARGB integer like the constants in _Color) to be applied by the standard Style templates when presenting this notification.
ContentIntentPendingIntent. The intent to execute when the expanded status entry is clicked.
ContentViewRemoteViews. The view that will represent this notification in the expanded status bar.
[read-only]
static
CreatorIParcelableCreator. Parcelable.
DefaultsNotificationDefaults. Specifies which values should be taken from the defaults.
DeleteIntentPendingIntent. 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.
ExtrasBundle. Additional semantic data to be carried around with this Notification.
FlagsNotificationFlags.
FullScreenIntentPendingIntent. An intent to launch instead of posting the notification to the status bar.
[read-only]
GroupString. Get the key used to group this notification into a cluster or stack with other notifications on devices which support such rendering.
HeadsUpContentViewRemoteViews. A medium-format version of Notification.ContentView, providing the Notification an opportunity to add action buttons to contentView.
IconInt32. The resource id of a drawable to use as the icon in the status bar.
IconLevelInt32. If the icon in the status bar is to have more than one level, you can set this.
LargeIconBitmap. A large bitmap to be shown in the notification content area.
LedARGBInt32. The color of the led.
LedOffMSInt32. The number of milliseconds for the LED to be off while it's flashing.
LedOnMSInt32. The number of milliseconds for the LED to be on while it's flashing.
NumberInt32. The number of events that this notification represents.
PriorityInt32. Relative priority for this notification.
PublicVersionNotification. Replacement version of this notification whose content will be shown in an insecure context such as atop a secure keyguard.
[read-only]
SortKeyString. Get a sort key that orders this notification among other notifications from the same package.
SoundUri. The sound to play.
TickerTextICharSequence. Text that summarizes this notification for accessibility services.
TickerViewRemoteViews. Formerly, a view showing the Notification.TickerText.
VibrateInt64[]. The pattern with which to vibrate.
VisibilityNotificationVisibility. 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).
WhenInt64. A timestamp related to this notification, in milliseconds since the epoch.

Protected Properties

[read-only]
override
ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
[read-only]
override
ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Public Methods

Clone() : Notification
Creates and returns a copy of this Object.
DescribeContents() : Int32
Describe the kinds of special objects contained in this Parcelable's marshalled representation.
SetLatestEventInfo(Context, ICharSequence, ICharSequence, PendingIntent)
Sets the Notification.ContentView) field to be a view with the standard "Latest Event" layout.
SetLatestEventInfo(Context, String, String, PendingIntent)
Sets the Notification.ContentView property to be a view with the standard "Latest Event" layout. Uses the Notification.Icon and Notification.When fields to set the icon and time fields in the view.
WriteToParcel(Parcel, ParcelableWriteFlags)
Flatten this notification into a parcel.