IT. Expert System.

Android Reference


Class NotificationCompat.Builder

  • Enclosing class:

    public static class NotificationCompat.Builder
    extends Object
    Builder class for Notification objects. Allows easier control over all the flags, as well as help constructing the typical notification layouts.
    • Constructor Detail

      • NotificationCompat.Builder

        public NotificationCompat.Builder(Context context)
        Constructor. Automatically sets the when field to System.currentTimeMillis() and the audio stream to the Notification.STREAM_DEFAULT.
        context - A Context that will be used to construct the RemoteViews. The Context will not be held past the lifetime of this Builder object.
    • Method Detail

      • setWhen

        public NotificationCompat.Builder setWhen(long when)
        Set the time that the event occurred. Notifications in the panel are sorted by this time.
      • setUsesChronometer

        public NotificationCompat.Builder setUsesChronometer(boolean b)
        Show the Notification.when field as a stopwatch. Instead of presenting when as a timestamp, the notification will show an automatically updating display of the minutes and seconds since when. Useful when showing an elapsed time (like an ongoing phone call).
        See Also:
        Chronometer, Notification.when
      • setSmallIcon

        public NotificationCompat.Builder setSmallIcon(int icon)
        Set the small icon to use in the notification layouts. Different classes of devices may return different sizes. See the UX guidelines for more information on how to design these icons.
        icon - A resource ID in the application's package of the drawble to use.
      • setNumber

        public NotificationCompat.Builder setNumber(int number)
        Set the large number at the right-hand side of the notification. This is equivalent to setContentInfo, although it might show the number in a different font size for readability.
      • setProgress

        public NotificationCompat.Builder setProgress(int max,
                                             int progress,
                                             boolean indeterminate)
        Set the progress this notification represents, which may be represented as a ProgressBar.
      • setFullScreenIntent

        public NotificationCompat.Builder setFullScreenIntent(PendingIntent intent,
                                                     boolean highPriority)
        An intent to launch instead of posting the notification to the status bar. Only for use with extremely high-priority notifications demanding the user's immediate attention, such as an incoming phone call or alarm clock that the user has explicitly set to a particular time. If this facility is used for something else, please give the user an option to turn it off and use a normal notification, as this can be extremely disruptive.
        intent - The pending intent to launch.
        highPriority - Passing true will cause this notification to be sent even if other notifications are suppressed.
      • setTicker

        public NotificationCompat.Builder setTicker(CharSequence tickerText,
                                           RemoteViews views)
        Set the text that is displayed in the status bar when the notification first arrives, and also a RemoteViews object that may be displayed instead on some devices.
      • setLights

        public NotificationCompat.Builder setLights(int argb,
                                           int onMs,
                                           int offMs)
        Set the argb value that you would like the LED on the device to blnk, as well as the rate. The rate is specified in terms of the number of milliseconds to be on and then the number of milliseconds to be off.
      • setOngoing

        public NotificationCompat.Builder setOngoing(boolean ongoing)
        Set whether this is an ongoing notification.

        Ongoing notifications differ from regular notifications in the following ways:

        • Ongoing notifications are sorted above the regular notifications in the notification panel.
        • Ongoing notifications do not have an 'X' close button, and are not affected by the "Clear all" button.
      • setOnlyAlertOnce

        public NotificationCompat.Builder setOnlyAlertOnce(boolean onlyAlertOnce)
        Set this flag if you would only like the sound, vibrate and ticker to be played if the notification is not already showing.
      • setPriority

        public NotificationCompat.Builder setPriority(int pri)
        Set the 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.
      • addAction

        public NotificationCompat.Builder addAction(int icon,
                                           CharSequence title,
                                           PendingIntent intent)
        Add an action to this notification. Actions are typically displayed by the system as a button adjacent to the notification content.
        icon - Resource ID of a drawable that represents the action.
        title - Text describing the action.
        intent - PendingIntent to be fired when the action is invoked.


Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)





Java Script








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

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: 2367 / . Delta: 0.04570 с