1
我正在使用一个AsyncTask,它下载一个apk文件,然后以后执行方法安装它。Android存储多个通知ID并允许同时显示多个通知
预执行 {
Get a notification variable from shared preference and adds +1 to it
Create a new notification based on this variable
}
做背景 {
Update this notification based on its ID -1 (to refer to initial notification ID)
}
后执行 {
Update this notification based on its ID -1 (to refer to initial notification ID)
}
同时该线程运行时(例如下载网络上非常大的文件),我将允许用户启动另一个下载时。在这种情况下,我想显示2个通知,而不是重复使用相同的通知ID。当我在后台执行和后台执行线程中引用其通知ID时,具有两个唯一通知ID的最佳方式是什么?谢谢