Android 通知详解

原文链接:http://www.hackvip.com/mobiwen/html/Mobile_219698.html

 

NotificationManager nm =
  (NotificationManager)getSystemService(NOTIFICATION_SERVICE);
  Notification代表着一个通知.
  Notification的属性:
  audioStreamType 当声音响起时,所用的音频流的类型
  contentIntent 当通知条目被点击,就执行这个被设置的Intent.
  contentView 当通知被显示在状态条上的时候,同时这个被设置的视图被显示.
  defaults 指定哪个值要被设置成默认的.
  deleteIntent 当用户点击"Clear All Notifications"按钮区删除所有的通知的时候,这个被设置的Intent被执行.
  icon 状态条所用的图片.
  iconLevel 假如状态条的图片有几个级别,就设置这里.
  ledARGB LED灯的颜色.
  ledOffMS LED关闭时的闪光时间(以毫秒计算)
  ledOnMS LED开始时的闪光时间(以毫秒计算)
  number 这个通知代表事件的号码
  sound 通知的声音
  tickerText 通知被显示在状态条时,所显示的信息
  vibrate 振动模式.
  when 通知的时间戳.
  Notification的公共方法:
  describeContents() Describe the kinds of special objects contained in this Parcelable's marshalled representation.
  setLatestEventInfo(Context context, CharSequence contentTitle, CharSequence
======黑软基地手机资讯频道======
  
contentText, PendingIntent contentIntent) 设置Notification留言条的参数
  writeToParcel(Parcel parcel, int flags) Flatten this notification from a parcel.
  toString() …………….
  将Notification发送到状态条上:
  Java代码
  Notification notification = new Notification();
  Notification的设置过程……..
  nm.notify(0, notification); //发送到状态条上

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值