IT. Expert System.

Android Reference

Notification


android.app

Class Notification

    • Field Detail

      • DEFAULT_ALL

        public static final int DEFAULT_ALL
        Use all default values (where applicable).
        See Also:
        Constant Field Values
      • DEFAULT_VIBRATE

        public static final int DEFAULT_VIBRATE
        Use the default notification vibrate. This will ignore any given vibrate. Using phone vibration requires the VIBRATE permission.
        See Also:
        defaults, Constant Field Values
      • when

        public long when
        A timestamp related to this notification, in milliseconds since the epoch. Default value: Now. Choose a timestamp that will be most relevant to the user. For most finite events, this corresponds to the time the event happened (or will happen, in the case of events that have yet to occur but about which the user is being informed). Indefinite events should be timestamped according to when the activity began. Some examples:
        • Notification of a new chat message should be stamped when the message was received.
        • Notification of an ongoing file download (with a progress bar, for example) should be stamped when the download started.
        • Notification of a completed file download should be stamped when the download finished.
        • Notification of an upcoming meeting should be stamped with the time the meeting will begin (that is, in the future).
        • Notification of an ongoing stopwatch (increasing timer) should be stamped with the watch's start time.
        • Notification of an ongoing countdown timer should be stamped with the timer's end time.
      • icon

        public int icon
        The resource id of a drawable to use as the icon in the status bar. This is required; notifications with an invalid icon resource will not be shown.
      • number

        public int number
        The number of events that this notification represents. For example, in a new mail notification, this could be the number of unread messages. The system may or may not use this field to modify the appearance of the notification. For example, before Build.VERSION_CODES.HONEYCOMB, this number was superimposed over the icon in the status bar. Starting with Build.VERSION_CODES.HONEYCOMB, the template used by Notification.Builder has displayed the number in the expanded notification view. If the number is 0 or negative, it is never shown.
      • contentIntent

        public PendingIntent contentIntent
        The intent to execute when the expanded status entry is clicked. If this is an activity, it must include the Intent.FLAG_ACTIVITY_NEW_TASK flag, which requires that you take care of task management as described in the Tasks and Back Stack document. In particular, make sure to read the notification section Handling Notifications for the correct ways to launch an application from a notification.
      • deleteIntent

        public PendingIntent 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. This probably shouldn't be launching an activity since several of those will be sent at the same time.
      • tickerText

        public CharSequence tickerText
        Text to scroll across the screen when this item is added to the status bar on large and smaller devices.
        See Also:
        tickerView
      • tickerView

        public RemoteViews tickerView
        The view to show as the ticker in the status bar when the notification is posted.
      • contentView

        public RemoteViews contentView
        The view that will represent this notification in the expanded status bar.
      • bigContentView

        public RemoteViews bigContentView
        A large-format version of contentView, giving the Notification an opportunity to show more detail. The system UI may choose to show this instead of the normal content view at its discretion.
      • largeIcon

        public Bitmap largeIcon
        The bitmap that may escape the bounds of the panel and bar.
      • sound

        public Uri sound
        The sound to play.

        To play the default notification sound, see defaults.

      • STREAM_DEFAULT

        public static final int STREAM_DEFAULT
        Use this constant as the value for audioStreamType to request that the default stream type for notifications be used. Currently the default stream type is AudioManager.STREAM_NOTIFICATION.
        See Also:
        Constant Field Values
      • audioStreamType

        public int audioStreamType
        The audio stream type to use when playing the sound. Should be one of the STREAM_ constants from AudioManager.
      • ledARGB

        public int ledARGB
        The color of the led. The hardware will do its best approximation.
        See Also:
        FLAG_SHOW_LIGHTS, flags
      • ledOnMS

        public int ledOnMS
        The number of milliseconds for the LED to be on while it's flashing. The hardware will do its best approximation.
        See Also:
        FLAG_SHOW_LIGHTS, flags
      • ledOffMS

        public int ledOffMS
        The number of milliseconds for the LED to be off while it's flashing. The hardware will do its best approximation.
        See Also:
        FLAG_SHOW_LIGHTS, flags
      • FLAG_SHOW_LIGHTS

        public static final int FLAG_SHOW_LIGHTS
        Bit to be bitwise-ored into the flags field that should be set if you want the LED on for this notification.
        • To turn the LED off, pass 0 in the alpha channel for colorARGB or 0 for both ledOnMS and ledOffMS.
        • To turn the LED on, pass 1 for ledOnMS and 0 for ledOffMS.
        • To flash the LED, pass the number of milliseconds that it should be on and off to ledOnMS and ledOffMS.

        Since hardware varies, you are not guaranteed that any of the values you pass are honored exactly. Use the system defaults (TODO) if possible because they will be set to values that work on any given hardware.

        The alpha channel must be set for forward compatibility.

        See Also:
        Constant Field Values
      • FLAG_ONGOING_EVENT

        public static final int FLAG_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. It should not be set if this notification is in reference to something that happened at a particular point in time, like a missed phone call.
        See Also:
        Constant Field Values
      • FLAG_INSISTENT

        public static final int FLAG_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.
        See Also:
        Constant Field Values
      • FLAG_ONLY_ALERT_ONCE

        public static final int FLAG_ONLY_ALERT_ONCE
        Bit to be bitwise-ored into the flags field that should be set if you want the sound and/or vibration play each time the notification is sent, even if it has not been canceled before that.
        See Also:
        Constant Field Values
      • FLAG_AUTO_CANCEL

        public static final int FLAG_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. On tablets, the
        See Also:
        Constant Field Values
      • FLAG_NO_CLEAR

        public static final int FLAG_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.
        See Also:
        Constant Field Values
      • FLAG_HIGH_PRIORITY

        public static final int FLAG_HIGH_PRIORITY
        Deprecated. Use priority with a positive value.
        Obsolete flag indicating high-priority notifications; use the priority field instead.
        See Also:
        Constant Field Values
      • flags

        public int flags
      • PRIORITY_DEFAULT

        public static final int PRIORITY_DEFAULT
        Default notification priority. If your application does not prioritize its own notifications, use this value for all notifications.
        See Also:
        Constant Field Values
      • PRIORITY_LOW

        public static final int PRIORITY_LOW
        Lower priority, for items that are less important. The UI may choose to show these items smaller, or at a different position in the list, compared with your app's PRIORITY_DEFAULT items.
        See Also:
        Constant Field Values
      • PRIORITY_MIN

        public static final int PRIORITY_MIN
        Lowest priority; these items might not be shown to the user except under special circumstances, such as detailed notification logs.
        See Also:
        Constant Field Values
      • PRIORITY_HIGH

        public static final int PRIORITY_HIGH
        Higher priority, for more important notifications or alerts. The UI may choose to show these items larger, or at a different position in notification lists, compared with your app's PRIORITY_DEFAULT items.
        See Also:
        Constant Field Values
      • PRIORITY_MAX

        public static final int PRIORITY_MAX
        Highest priority, for your application's most important items that require the user's prompt attention or input.
        See Also:
        Constant Field Values
      • priority

        public int priority
        Relative priority for this notification. Priority is an indication of how much of the user's valuable attention should be consumed by this notification. Low-priority notifications may be hidden from the user in certain situations, while the user might be interrupted for a higher-priority notification. The system will make a determination about how to interpret notification priority as described in MUMBLE MUMBLE.
    • Constructor Detail

      • Notification

        public Notification()
        Constructs a Notification object with default values. You might want to consider using Notification.Builder instead.
      • Notification

        @Deprecated
        public Notification(int icon,
                               CharSequence tickerText,
                               long when)
        Deprecated. Use Notification.Builder instead.
        Constructs a Notification object with the information needed to have a status bar icon without the standard expanded view.
        Parameters:
        icon - The resource id of the icon to put in the status bar.
        tickerText - The text that flows by in the status bar when the notification first activates.
        when - The time to show in the time field. In the System.currentTimeMillis timebase.
      • Notification

        public Notification(Parcel parcel)
        Unflatten the notification from a parcel.
    • Method Detail

      • clone

        public Notification clone()
        Description copied from class: Object
        Creates and returns a copy of this Object. The default implementation returns a so-called "shallow" copy: It creates a new instance of the same class and then copies the field values (including object references) from this instance to the new instance. A "deep" copy, in contrast, would also recursively clone nested objects. A subclass that needs to implement this kind of cloning should call super.clone() to create the new instance and then create deep copies of the nested, mutable objects.
        Overrides:
        clone in class Object
        Returns:
        a copy of this object.
      • describeContents

        public int describeContents()
        Description copied from interface: Parcelable
        Describe the kinds of special objects contained in this Parcelable's marshalled representation.
        Specified by:
        describeContents in interface Parcelable
        Returns:
        a bitmask indicating the set of special object types marshalled by the Parcelable.
      • writeToParcel

        public void writeToParcel(Parcel parcel,
                         int flags)
        Flatten this notification from a parcel.
        Specified by:
        writeToParcel in interface Parcelable
        Parameters:
        parcel - The Parcel in which the object should be written.
        flags - Additional flags about how the object should be written. May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE.
      • setLatestEventInfo

        @Deprecated
        public void setLatestEventInfo(Context context,
                                         CharSequence contentTitle,
                                         CharSequence contentText,
                                         PendingIntent contentIntent)
        Deprecated. Use Notification.Builder instead.
        Sets the contentView field 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.

        Parameters:
        context - The context for your application / activity.
        contentTitle - The title that goes in the expanded entry.
        contentText - The text that goes in the expanded entry.
        contentIntent - The intent to launch when the user clicks the expanded notification. If this is an activity, it must include the Intent.FLAG_ACTIVITY_NEW_TASK flag, which requires that you take care of task management as described in the Tasks and Back Stack document.
      • toString

        public String toString()
        Description copied from class: Object
        Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:
           getClass().getName() + '@' + Integer.toHexString(hashCode())

        See Writing a useful toString method if you intend implementing your own toString method.

        Overrides:
        toString in class Object
        Returns:
        a printable representation of this object.


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 728 / . Delta: 0.02371 с