【问题标题】:PendingIntent and DownloadManagerPendingIntent 和 DownloadManager
【发布时间】:2014-07-31 17:57:24
【问题描述】:

有没有办法通过下载管理器设置 PendingIntent?还是 DownloadManager.Request?我正在工具栏中向用户发送有关下载的通知:

request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);

请求是这样初始化的:

DownloadManager.Request request = new DownloadManager.Request(Uri.parse(url));

我需要它,以便当用户单击此通知时,他们会被带到活动或下载文件的位置。

【问题讨论】:

    标签: android android-pendingintent android-download-manager notificationmanager


    【解决方案1】:

    我认为您的问题已在此question 中得到解答。

    也就是说,注意ACTION_NOTIFICATION_CLICKEDACTION_DOWNLOAD_COMPLETE 的操作。

    如果您需要更多控制权,您可以使用自己的通知,在下载完成后使用您的 PendingIntent 更新它。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-08-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-01-06
      相关资源
      最近更新 更多