|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectandroid.app.Notification
public class Notification
A class that represents how a persistent notification is to be presented to
the user using the NotificationManager.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface android.os.Parcelable |
|---|
Parcelable.Creator<T> |
| Field Summary | |
|---|---|
int |
audioStreamType
The audio stream type to use when playing the sound. |
PendingIntent |
contentIntent
The intent to execute when the expanded status entry is clicked. |
RemoteViews |
contentView
The view that shows when this notification is shown in the expanded status bar. |
static Parcelable.Creator<Notification> |
CREATOR
Parcelable.Creator that instantiates Notification objects |
static int |
DEFAULT_ALL
Use all default values (where applicable). |
static int |
DEFAULT_LIGHTS
Use the default notification lights. |
static int |
DEFAULT_SOUND
Use the default notification sound. |
static int |
DEFAULT_VIBRATE
Use the default notification vibrate. |
int |
defaults
Specifies which values should be taken from the defaults. |
PendingIntent |
deleteIntent
The intent to execute when the status entry is deleted by the user with the "Clear All Notifications" button. |
static 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. |
static int |
FLAG_INSISTENT
Bit to be bitwise-ored into the flags field that if set,
the audio and vibration will be repeated until the notification is
cancelled. |
static 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. |
static 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. |
static 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. |
static 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. |
int |
flags
|
int |
icon
The resource id of a drawable to use as the icon in the status bar. |
int |
iconLevel
If the icon in the status bar is to have more than one level, you can set this. |
int |
ledARGB
The color of the led. |
int |
ledOffMS
The number of milliseconds for the LED to be off while it's flashing. |
int |
ledOnMS
The number of milliseconds for the LED to be on while it's flashing. |
int |
number
The number of events that this notification represents. |
Uri |
sound
The sound to play. |
static int |
STREAM_DEFAULT
Use this constant as the value for audioStreamType to request that the default stream type for notifications be used. |
CharSequence |
tickerText
Text to scroll across the screen when this item is added to the status bar. |
long[] |
vibrate
The pattern with which to vibrate. |
long |
when
The timestamp for the notification. |
| Fields inherited from interface android.os.Parcelable |
|---|
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE |
| Constructor Summary | |
|---|---|
Notification()
Constructs a Notification object with everything set to 0. |
|
Notification(Context context,
int icon,
CharSequence tickerText,
long when,
CharSequence contentTitle,
CharSequence contentText,
Intent contentIntent)
Deprecated. use Notification(int,CharSequence,long) and setLatestEventInfo(android.content.Context, java.lang.CharSequence, java.lang.CharSequence, android.app.PendingIntent). |
|
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. |
|
Notification(Parcel parcel)
Unflatten the notification from a parcel. |
|
| Method Summary | |
|---|---|
int |
describeContents()
Describe the kinds of special objects contained in this Parcelable's marshalled representation. |
void |
setLatestEventInfo(Context context,
CharSequence contentTitle,
CharSequence contentText,
PendingIntent contentIntent)
Sets the contentView field to be a view with the standard "Latest Event"
layout. |
String |
toString()
Returns a string containing a concise, human-readable description of the receiver. |
void |
writeToParcel(Parcel parcel,
int flags)
Flatten this notification from a parcel. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int DEFAULT_ALL
public static final int DEFAULT_SOUND
sound.
defaults,
Constant Field Valuespublic static final int DEFAULT_VIBRATE
vibrate.
defaults,
Constant Field Valuespublic static final int DEFAULT_LIGHTS
FLAG_SHOW_LIGHTS bit, and ledARGB, ledOffMS, or
ledOnMS.
defaults,
Constant Field Valuespublic long when
public int icon
public int number
public PendingIntent contentIntent
Intent.FLAG_ACTIVITY_NEW_TASK flag, which requires
that you take care of task management as described in the
application model document.
public PendingIntent deleteIntent
public CharSequence tickerText
public RemoteViews contentView
public int iconLevel
ImageView.setImageLevel(int),
android.graphics.drawable#setLevelpublic Uri sound
To play the default notification sound, see defaults.
public static final int STREAM_DEFAULT
public int audioStreamType
AudioManager.
public long[] vibrate
FLAG_INSISTENT bit is set in the flags field.
To vibrate the default pattern, see defaults.
Vibrator.vibrate(long[],int)public int ledARGB
FLAG_SHOW_LIGHTS,
flagspublic int ledOnMS
FLAG_SHOW_LIGHTS,
flagspublic int ledOffMS
FLAG_SHOW_LIGHTS,
flagspublic int defaults
To set, OR the desired from DEFAULT_SOUND,
DEFAULT_VIBRATE, DEFAULT_LIGHTS. For all default
values, use DEFAULT_ALL.
public static final int FLAG_SHOW_LIGHTS
flags field that should be
set if you want the LED on for this notification.
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.
public static final int FLAG_ONGOING_EVENT
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.
public static final int FLAG_INSISTENT
flags field that if set,
the audio and vibration will be repeated until the notification is
cancelled.
NOTE: This notion will change when we have decided exactly what the UI will be.
public static final int FLAG_ONLY_ALERT_ONCE
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.
public static final int FLAG_AUTO_CANCEL
flags field that should be
set if the notification should be canceled when it is clicked by the
user.
public static final int FLAG_NO_CLEAR
flags field that should be
set if the notification should not be canceled when the user clicks
the Clear all button.
public int flags
public static final Parcelable.Creator<Notification> CREATOR
| Constructor Detail |
|---|
public Notification()
public Notification(Context context,
int icon,
CharSequence tickerText,
long when,
CharSequence contentTitle,
CharSequence contentText,
Intent contentIntent)
Notification(int,CharSequence,long) and setLatestEventInfo(android.content.Context, java.lang.CharSequence, java.lang.CharSequence, android.app.PendingIntent).
public Notification(int icon,
CharSequence tickerText,
long when)
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.public Notification(Parcel parcel)
| Method Detail |
|---|
public int describeContents()
Parcelable
describeContents in interface Parcelable
public void writeToParcel(Parcel parcel,
int flags)
writeToParcel in interface Parcelableparcel - 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.
public void setLatestEventInfo(Context context,
CharSequence contentTitle,
CharSequence contentText,
PendingIntent contentIntent)
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.
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
application model document.public String toString()
Object
toString in class Object
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||