AgentWeb icon indicating copy to clipboard operation
AgentWeb copied to clipboard

Android 12 下载文件报错

Open 774312674 opened this issue 3 years ago • 1 comments

java.lang.IllegalArgumentException: com.xxx: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
    at android.app.PendingIntent.checkFlags(PendingIntent.java:375)
    at android.app.PendingIntent.getActivityAsUser(PendingIntent.java:458)
    at android.app.PendingIntent.getActivity(PendingIntent.java:444)
    at android.app.PendingIntent.getActivity(PendingIntent.java:408)
    at com.download.library.DownloadNotifier.initBuilder(DownloadNotifier.java:110)
    at com.download.library.DownloadTask.createNotifier(DownloadTask.java:507)
    at com.download.library.DownloadSubmitterImpl$DownloadStartTask.run(DownloadSubmitterImpl.java:178)
    at com.download.library.DownloadSubmitterImpl$1.run(DownloadSubmitterImpl.java:93)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    at java.lang.Thread.run(Thread.java:920)

774312674 avatar Jul 17 '22 08:07 774312674

目标平台 12+ 需要在创建 PendingIntent 传入 PendingIntent.FLAG_MUTABLE 或者 PendingIntent.FLAG_IMMUTABLE

声明 PendingIntent 可变性

AyakaAgo avatar Jul 24 '22 10:07 AyakaAgo

目标平台 12+ 需要在创建 PendingIntent 传入 PendingIntent.FLAG_MUTABLE 或者 PendingIntent.FLAG_IMMUTABLE

声明 PendingIntent 可变性

怎么写,请指点~谢谢

geeklx avatar Aug 27 '22 07:08 geeklx

目标平台 12+ 需要在创建 PendingIntent 传入 PendingIntent.FLAG_MUTABLE 或者 PendingIntent.FLAG_IMMUTABLE 声明 PendingIntent 可变性

怎么写,请指点~谢谢

创建通知时报错,可以设置setEnableIndicator(false)不创建通知 ,或者在源码中的PendingIntent

774312674 avatar Aug 27 '22 09:08 774312674

目标平台 12+ 需要在创建 PendingIntent 传入 PendingIntent.FLAG_MUTABLE 或者 PendingIntent.FLAG_IMMUTABLE 声明 PendingIntent 可变性

怎么写,请指点~谢谢

创建通知时报错,可以设置setEnableIndicator(false)不创建通知 ,或者在源码中的PendingIntent

挖槽 感谢大佬指点

geeklx avatar Aug 27 '22 10:08 geeklx