http://blog.csdn.net/y815007145/article/details/6205472

此文主要讲解 setLatestEventInfo的作用,他是Notification 的一个方法。下面以实际代码讲解用法。

Notification notification = new Notificatio(drawable,tickerText,System.currentTimeMillis()); //此处定义了一个Notification ,其中第一个参数代表图标

第二个参数代表提示的内容,第三个参数是指要显示的时间,一般是当即显示,故填入系统当前时间。

PendingIntent contentIntent = PendingIntent.getActivity(this, 0, new Intent(this, ActivityMain.class), 0);//该语句的作用是定义了一个不是当即显示的activity,只有当用户拉下notify显示列表,并且单击对应的项的时候,才会触发系统跳转到该activity.

notification.setLatestEventInfo(this, title, content, contentIntent);//在此处设置在nority列表里的该norifycation得显示情况。

mNotificationManager.notify(NOTIFICATIONS_ID, notification);

更多相关文章

  1. android SmartTabLayout——自定义标题带的Android ViewPager
  2. android自定义button样式
  3. 百度地图自定义公交路线源码
  4. Android 7.0自定义dialog错误permission denied for window type
  5. android 自定义dialog,窗口动画,
  6. android 自带APP 作用
  7. Android 自定义控件 ViewPager头部指示器控件 ViewPagerBelowInd

随机推荐

  1. MySQL中几种插入和批量语句实例详解
  2. MySQL 如何限制一张表的记录数
  3. MySQL into_Mysql中replace与replace int
  4. MYSQL 的10大经典优化案例场景实战
  5. MySQL 数据库定时备份的几种方式(全面)
  6. Mysql 字符集不一致导致连表异常的解决
  7. 五分钟带你搞懂MySQL索引下推
  8. 一篇文章读懂什么是MySQL索引下推(ICP)
  9. MySQL索引下推(ICP)的简单理解与示例
  10. 五分钟让你快速弄懂MySQL索引下推