Java android.app Notification fields, constructors, methods, implement or subclass

Example usage for Java android.app Notification fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for android.app Notification.

The text is from its open source code.

Field

StringINTENT_CATEGORY_NOTIFICATION_PREFERENCES
An activity that provides a user interface for adjusting notification preferences for its containing application.
intDEFAULT_ALL
Use all default values (where applicable).
intDEFAULT_SOUND
Use the default notification sound.
intDEFAULT_VIBRATE
Use the default notification vibrate.
intDEFAULT_LIGHTS
Use the default notification lights.
intSTREAM_DEFAULT
Use this constant as the value for audioStreamType to request that the default stream type for notifications be used.
intFLAG_SHOW_LIGHTS
Bit to be bitwise-ored into the #flags field that should be set if you want the LED on for this notification.
intFLAG_ONGOING_EVENT
Bit to be bitwise-ored into the #flags field that should be set if this notification is in reference to something that is ongoing, like a phone call.
intFLAG_INSISTENT
Bit to be bitwise-ored into the #flags field that if set, the audio will be repeated until the notification is cancelled or the notification window is opened.
intFLAG_ONLY_ALERT_ONCE
Bit to be bitwise-ored into the #flags field that should be set if you would only like the sound, vibrate and ticker to be played if the notification was not already showing.
intFLAG_AUTO_CANCEL
Bit to be bitwise-ored into the #flags field that should be set if the notification should be canceled when it is clicked by the user.
intFLAG_NO_CLEAR
Bit to be bitwise-ored into the #flags field that should be set if the notification should not be canceled when the user clicks the Clear all button.
intFLAG_FOREGROUND_SERVICE
Bit to be bitwise-ored into the #flags field that should be set if this notification represents a currently running service.
intFLAG_LOCAL_ONLY
Bit to be bitswise-ored into the #flags field that should be set if this notification is relevant to the current device only and it is not recommended that it bridge to other devices.
intFLAG_GROUP_SUMMARY
Bit to be bitswise-ored into the #flags field that should be set if this notification is the group summary for a group of notifications.
intflags
intPRIORITY_DEFAULT
Default notification #priority .
intPRIORITY_LOW
Lower #priority , for items that are less important.
intPRIORITY_MIN
Lowest #priority ; these items might not be shown to the user except under special circumstances, such as detailed notification logs.
intPRIORITY_HIGH
Higher #priority , for more important notifications or alerts.
intPRIORITY_MAX
Highest #priority , for your application's most important items that require the user's prompt attention or input.
intCOLOR_DEFAULT
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.
intVISIBILITY_PUBLIC
Notification visibility: Show this notification in its entirety on all lockscreens.
intVISIBILITY_PRIVATE
Notification visibility: Show this notification on all lockscreens, but conceal sensitive or private information on secure lockscreens.
intVISIBILITY_SECRET
Notification visibility: Do not reveal any part of this notification on a secure lockscreen.
StringCATEGORY_CALL
Notification category: incoming call (voice or video) or similar synchronous communication request.
StringCATEGORY_MESSAGE
Notification category: incoming direct message (SMS, instant message, etc.).
StringCATEGORY_EMAIL
Notification category: asynchronous bulk message (email).
StringCATEGORY_PROMO
Notification category: promotion or advertisement.
StringCATEGORY_ALARM
Notification category: alarm or timer.
StringCATEGORY_SOCIAL
Notification category: social network or sharing update.
StringCATEGORY_ERROR
Notification category: error in background operation or authentication status.
StringCATEGORY_TRANSPORT
Notification category: media transport control for playback.
StringCATEGORY_SYSTEM
Notification category: system or device status update.
StringCATEGORY_SERVICE
Notification category: indication of running background service.
StringCATEGORY_RECOMMENDATION
Notification category: a specific, timely recommendation for a single thing.
StringCATEGORY_STATUS
Notification category: ongoing information about device or contextual status.
StringCATEGORY_REMINDER
Notification category: user-scheduled reminder.
StringEXTRA_TITLE
#extras key: this is the title of the notification, as supplied to Builder#setContentTitle(CharSequence) .
StringEXTRA_TITLE_BIG
#extras key: this is the title of the notification when shown in expanded form, e.g.
StringEXTRA_TEXT
#extras key: this is the main text payload, as supplied to Builder#setContentText(CharSequence) .
StringEXTRA_SUB_TEXT
#extras key: this is a third line of text, as supplied to Builder#setSubText(CharSequence) .
StringEXTRA_INFO_TEXT
#extras key: this is a small piece of additional text as supplied to Builder#setContentInfo(CharSequence) .
StringEXTRA_SUMMARY_TEXT
#extras key: this is a line of summary information intended to be shown alongside expanded notifications, as supplied to (e.g.) BigTextStyle#setSummaryText(CharSequence) .
StringEXTRA_SMALL_ICON
#extras key: this is the resource ID of the notification's main small icon, as supplied to Builder#setSmallIcon(int) .
StringEXTRA_LARGE_ICON
#extras key: this is a bitmap to be used instead of the small icon when showing the notification payload, as supplied to Builder#setLargeIcon(android.graphics.Bitmap) .
StringEXTRA_PROGRESS
#extras key: this is the progress value supplied to Builder#setProgress(int,int,boolean) .
StringEXTRA_PROGRESS_MAX
#extras key: this is the maximum value supplied to Builder#setProgress(int,int,boolean) .
StringEXTRA_PROGRESS_INDETERMINATE
#extras key: whether the progress bar is indeterminate, supplied to Builder#setProgress(int,int,boolean) .
StringEXTRA_SHOW_CHRONOMETER
#extras key: whether #when should be shown as a count-up timer (specifically a android.widget.Chronometer ) instead of a timestamp, as supplied to Builder#setUsesChronometer(boolean) .
StringEXTRA_SHOW_WHEN
#extras key: whether #when should be shown, as supplied to Builder#setShowWhen(boolean) .
StringEXTRA_TEXT_LINES
#extras key: An array of CharSequences to show in InboxStyle expanded notifications, each of which was supplied to InboxStyle#addLine(CharSequence) .
StringEXTRA_PEOPLE
#extras key: A String array containing the people that this notification relates to, each of which was supplied to Builder#addPerson(String) .
StringEXTRA_BACKGROUND_IMAGE_URI
#extras key: A android.content.ContentUris content URI pointing to an image that can be displayed in the background when the notification is selected.
intBADGE_ICON_SMALL
If this notification is being shown as a badge, use the #getSmallIcon() to represent this notification.

Constructor

Notification()
Constructs a Notification object with default values.
Notification(int icon, CharSequence tickerText, long when)
Constructs a Notification object with the information needed to have a status bar icon without the standard expanded view.

Method

StringgetChannelId()
Returns the id of the channel this notification posts to.
ClassgetClass()
Returns the runtime class of this Object .
StringgetGroup()
Get the key used to group this notification into a cluster or stack with other notifications on devices which support such rendering.
StringgetSortKey()
Get a sort key that orders this notification among other notifications from the same package.
inthashCode()
Returns a hash code value for the object.
voidsetLatestEventInfo(Context context, CharSequence contentTitle, CharSequence contentText, PendingIntent contentIntent)
Sets the #contentView field to be a view with the standard "Latest Event" layout.
StringtoString()