Notification Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
A class that represents how a persistent notification is to be presented to
the user using the android.app.NotificationManager
.
[Android.Runtime.Register("android/app/Notification", DoNotGenerateAcw=true)]
public class Notification : Java.Lang.Object, Android.OS.IParcelable, IDisposable, Java.Interop.IJavaPeerable
[<Android.Runtime.Register("android/app/Notification", DoNotGenerateAcw=true)>]
type Notification = class
inherit Object
interface IParcelable
interface IJavaObject
interface IDisposable
interface IJavaPeerable
- Inheritance
- Attributes
- Implements
Remarks
A class that represents how a persistent notification is to be presented to the user using the android.app.NotificationManager
.
The Notification.Builder Notification.Builder
has been added to make it easier to construct Notifications.
<div class="special reference"> <h3>Developer Guides</h3>
For a guide to creating notifications, read the Status Bar Notifications developer guide.
</div>
Java documentation for android.app.Notification
.
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() |
Constructs a Notification object with default values. |
Notification(Int32, ICharSequence, Int64) |
Obsolete.
Constructs a Notification object with the information needed to have a status bar icon without the standard expanded view. |
Notification(Int32, ICharSequence) |
Constructs a |
Notification(Int32, String, Int64) |
Constructs a Notification object with the information needed to have a status bar icon without the standard expanded view. |
Notification(Int32, String) |
Constructs a |
Notification(IntPtr, JniHandleOwnership) |
A constructor used when creating managed representations of JNI objects; called by the runtime. |
Notification(Parcel) |
Unflatten the notification from a parcel. |
Fields
CategoryAlarm |
Notification category: alarm or timer. |
CategoryCall |
Notification category: incoming call (voice or video) or similar synchronous communication request. |
CategoryEmail |
Notification category: asynchronous bulk message (email). |
CategoryError |
Notification category: error in background operation or authentication status. |
CategoryEvent |
Notification category: calendar event. |
CategoryLocationSharing |
Notification category: temporarily sharing location. |
CategoryMessage |
Notification category: incoming direct message (SMS, instant message, etc. |
CategoryMissedCall |
Notification category: missed call. |
CategoryNavigation |
Notification category: map turn-by-turn navigation. |
CategoryProgress |
Notification category: progress of a long-running background operation. |
CategoryPromo |
Notification category: promotion or advertisement. |
CategoryRecommendation |
Notification category: a specific, timely recommendation for a single thing. |
CategoryReminder |
Notification category: user-scheduled reminder. |
CategoryService |
Notification category: indication of running background service. |
CategorySocial |
Notification category: social network or sharing update. |
CategoryStatus |
Notification category: ongoing information about device or contextual status. |
CategoryStopwatch |
Notification category: running stopwatch. |
CategorySystem |
Notification category: system or device status update. |
CategoryTransport |
Notification category: media transport control for playback. |
CategoryWorkout |
Notification category: tracking a user's workout. |
ColorDefault |
Special value of |
ExtraAnswerColor |
|
ExtraAnswerIntent |
|
ExtraAudioContentsUri |
|
ExtraBackgroundImageUri |
|
ExtraBigText |
|
ExtraCallIsVideo |
|
ExtraCallPerson |
|
ExtraCallType |
|
ExtraChannelGroupId |
Optional extra for |
ExtraChannelId |
Optional extra for |
ExtraChronometerCountDown |
|
ExtraColorized |
|
ExtraCompactActions |
|
ExtraConversationTitle |
|
ExtraDeclineColor |
|
ExtraDeclineIntent |
|
ExtraHangUpIntent |
|
ExtraHistoricMessages |
|
ExtraInfoText |
|
ExtraIsGroupConversation |
|
ExtraLargeIcon |
|
ExtraLargeIconBig |
|
ExtraMediaSession |
|
ExtraMessages |
|
ExtraMessagingPerson |
|
ExtraNotificationId |
Optional extra for |
ExtraNotificationTag |
Optional extra for |
ExtraPeople |
|
ExtraPeopleList |
|
ExtraPicture |
|
ExtraPictureContentDescription |
|
ExtraPictureIcon |
|
ExtraProgress |
|
ExtraProgressIndeterminate |
|
ExtraProgressMax |
|
ExtraRemoteInputDraft |
If the notification contained an unsent draft for a RemoteInput when the user clicked on it,
we're adding the draft as a String extra to the |
ExtraRemoteInputHistory |
|
ExtraSelfDisplayName |
|
ExtraShowBigPictureWhenCollapsed |
|
ExtraShowChronometer |
|
ExtraShowWhen |
|
ExtraSmallIcon |
|
ExtraSubText |
|
ExtraSummaryText |
|
ExtraTemplate |
|
ExtraText |
|
ExtraTextLines |
|
ExtraTitle |
|
ExtraTitleBig |
|
ExtraVerificationIcon |
|
ExtraVerificationText |
|
ForegroundServiceDefault |
Obsolete.
If the Notification associated with starting a foreground service has been built using setForegroundServiceBehavior() with this behavior, display of the notification will usually be suppressed for a short time to avoid visual disturbances to the user. |
ForegroundServiceDeferred |
Obsolete.
If the Notification associated with starting a foreground service has been built using setForegroundServiceBehavior() with this behavior, display of the notification will usually be suppressed for a short time to avoid visual disturbances to the user. |
ForegroundServiceImmediate |
Obsolete.
If the Notification associated with starting a foreground service has been built using setForegroundServiceBehavior() with this behavior, display of the notification will be immediate even if the default behavior would be to defer visibility for a short time. |
IntentCategoryNotificationPreferences |
An activity that provides a user interface for adjusting notification preferences for its containing application. |
PriorityDefault |
Default notification |
PriorityHigh |
Higher |
PriorityLow |
Lower |
PriorityMax |
Highest |
PriorityMin |
Lowest |
Properties
Actions |
Array of all |
AllowSystemGeneratedContextualActions |
Returns whether the platform is allowed (by the app developer) to generate contextual actions for this notification. |
AudioAttributes |
The |
AudioAttributesDefault |
The default value of |
AudioStreamType |
Obsolete.
The audio stream type to use when playing the sound. |
BadgeIconType |
Returns what icon should be shown for this notification if it is being displayed in a Launcher that supports badging. |
BigContentView |
A large-format version of |
Category |
One of the predefined notification categories (see the |
ChannelId |
Returns the id of the channel this notification posts to. |
Class |
Returns the runtime class of this |
Color |
Accent color (an ARGB integer like the constants in |
ContentIntent |
The intent to execute when the expanded status entry is clicked. |
ContentView |
The view that will represent this notification in the notification list (which is pulled down from the status bar). |
ContextualActions |
Returns the actions that are contextual (that is, suggested because of the content of the notification) out of the actions in this notification. |
Creator |
Parcelable. |
Defaults |
Specifies which values should be taken from the defaults. |
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 |
Additional semantic data to be carried around with this Notification. |
Flags | |
FullScreenIntent |
An intent to launch instead of posting the notification to the status bar. |
Group |
Get the key used to group this notification into a cluster or stack with other notifications on devices which support such rendering. |
GroupAlertBehavior |
Returns which type of notifications in a group are responsible for audibly alerting the user. |
Handle |
The handle to the underlying Android instance. (Inherited from Object) |
HasImage | |
HeadsUpContentView |
A medium-format version of |
Icon |
The resource id of a drawable to use as the icon in the status bar. |
IconLevel |
If the icon in the status bar is to have more than one level, you can set this. |
JniIdentityHashCode | (Inherited from Object) |
JniPeerMembers | |
LargeIcon |
A large bitmap to be shown in the notification content area. |
LedARGB |
The color of the led. |
LedOffMS |
The number of milliseconds for the LED to be off while it's flashing. |
LedOnMS |
The number of milliseconds for the LED to be on while it's flashing. |
LocusId |
Gets the |
Number |
The number of events that this notification represents. |
PeerReference | (Inherited from Object) |
Priority |
Relative priority for this notification. |
PublicVersion |
Replacement version of this notification whose content will be shown in an insecure context such as atop a secure keyguard. |
SettingsText | |
SettingsTextFormatted |
Returns the settings text provided to |
ShortcutId |
Returns the |
SmallIcon |
The small icon representing this notification in the status bar and content view. |
SortKey |
Get a sort key that orders this notification among other notifications from the same package. |
Sound |
The sound to play. |
ThresholdClass |
This API supports the Mono for Android infrastructure and is not intended to be used directly from your code. |
ThresholdType |
This API supports the Mono for Android infrastructure and is not intended to be used directly from your code. |
TickerText |
Text that summarizes this notification for accessibility services. |
TickerView |
Obsolete.
Formerly, a view showing the |
TimeoutAfter |
Returns the duration from posting after which this notification should be canceled by the system, if it's not canceled already. |
Vibrate |
The pattern with which to vibrate. |
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 |
A timestamp related to this notification, in milliseconds since the epoch. |
Methods
Clone() |
Creates and returns a copy of this |
DescribeContents() |
Describe the kinds of special objects contained in this Parcelable's marshalled representation. |
Dispose() | (Inherited from Object) |
Dispose(Boolean) | (Inherited from Object) |
Equals(Object) |
Indicates whether some other object is "equal to" this one. (Inherited from Object) |
FindRemoteInputActionPair(Boolean) |
Finds and returns a remote input and its corresponding action. |
GetBubbleMetadata() |
Returns the bubble metadata that will be used to display app content in a floating window over the existing foreground activity. |
GetHashCode() |
Returns a hash code value for the object. (Inherited from Object) |
GetLargeIcon() |
The large icon shown in this notification's content view. |
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) |
SetHandle(IntPtr, JniHandleOwnership) |
Sets the Handle property. (Inherited from Object) |
SetLatestEventInfo(Context, ICharSequence, ICharSequence, PendingIntent) |
Obsolete.
Sets the |
SetLatestEventInfo(Context, String, String, PendingIntent) |
Obsolete.
Sets the |
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) |
WriteToParcel(Parcel, ParcelableWriteFlags) |
Flatten this notification into a parcel. |
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) |