Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2025596
  • 博文数量: 413
  • 博客积分: 10926
  • 博客等级: 上将
  • 技术积分: 3862
  • 用 户 组: 普通用户
  • 注册时间: 2006-01-09 18:14
文章分类

全部博文(413)

文章存档

2015年(5)

2014年(1)

2013年(5)

2012年(6)

2011年(138)

2010年(85)

2009年(42)

2008年(46)

2007年(26)

2006年(59)

分类: 嵌入式

2010-11-10 13:45:27

  1. Docs
    • http://developer.android.com/guide/topics/ui/notifiers/index.html
    • http://developer.android.com/guide/topics/ui/notifiers/toasts.html
    • http://developer.android.com/guide/topics/ui/notifiers/notifications.html
  2. Type
    • A Toast Notification, for brief messages that come from the background.
      • Basic
      • Positioning your Toast
      • Creating a Custom Toast View
    • A Status Bar Notification, for persistent reminders that come from the background and request the user's response.
    • A Dialog Notification, for Activity-related notifications.
  3. Notification on status bar
    • Common flags
      1. PendingIntent.FLAG_UPDATE_CURRENT
        Update contents on status bar if the notification already exists, it is used when to invoke PendingIntent.getActivity, PendingIntent.getBroadcast, and PendingIntent.getService.
      2. Notification.FLAG_AUTO_CANCEL
        Cancel the notification when it is clicked by user. It is bitwise-ored into the flags field of Notification.
      3. Notification.FLAG_NO_CLEAR
        Prevent user to cancel it. It is bitwise-ored into the flags field of Notification.
      4. xx
    • Notification
      1. Don't show time on status bar
        Notificaton notification = xxx.
        notification.when = 0; //Must invoke before setLatestEventInfo
        ... //Other statements
      2. xxx
    • NotificationManager
      1. id
        The id of notification is application's own resource, that mean multiple applications can define the same id.
      2. contentIntent
        this field must be set and it can't be null. If you don't want to trigger any intent when use click status bar, just use the following code snip:
        Intent intent = new Intent();
        PendingIntent pi = PendingIntent.getBroadcast(mContext, 0, intent, 0);
        notification.contentIntent = pi;
      3. xxx
    • xxx
  4. xxx
阅读(713) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~