markdowneide 2013-03-22 05:20 采纳率: 0%
浏览 3875
已采纳

如何更新 notification 进度条?

在我的安卓应用程序中有一个 Notification,并且 notification有一个进度条。
如果我更新 notification 的进度条的进度时,我是要传递 notification 的同一个实例呢,还是要传递 Notification 的一个新实例?
应该这样:

mNotification = new Notification(..); // create in the constructor of my activity
getNotificationManager().notify(TAG, FILE_UPLOAD_ID, mNotification);

还是:

getNotificationManager().notify(TAG, FILE_UPLOAD_ID, new Notification(...) );
  • 写回答

1条回答

  • Curie-87 2013-03-22 07:41
    关注
    public void notify (String tag, int id, Notification notification) Since: API Level 5
    

    在状态栏发布一个通知。如果程序中已经有一个通知有相同的标签和id,这个通知还没有取消,就会被更新的信息代替。
    参数标签A 字符串标识这个通知,可能为空,给这个通知分配 id 标识符。在程序中 tag,id 必须是唯一的。

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥50 树莓派安卓APK系统签名
  • ¥15 maple软件,用solve求反函数出现rootof,怎么办?
  • ¥65 汇编语言除法溢出问题
  • ¥15 Visual Studio问题
  • ¥15 state显示变量是字符串形式,但是仍然红色,无法引用,并显示类型不匹配
  • ¥20 求一个html代码,有偿
  • ¥100 关于使用MATLAB中copularnd函数的问题
  • ¥20 在虚拟机的pycharm上
  • ¥15 jupyterthemes 设置完毕后没有效果
  • ¥15 matlab图像高斯低通滤波