遇到如下报错: Fatal Exception: java.langlllegalArgumentException : Targeting S+ (version 31 and above) reures that one o
遇到如下报错:
Fatal Exception: java.langlllegalArgumentException
: Targeting S+ (version 31 and above) reures that one of FLAG_MMUTABLE r FLA-MUTABLE be specfed when creating a Pendinglntent. Strongly consider using FLAG_JMMUTABLE only use FLAG_MUTABLE if some unctionalty depends on the Pendinglintent being mutable e.g, ifitneeds to be used with inline replies or bubles
关于PendingIntent
PendingIntent alarmIntent;if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.S) { alarmIntent = PendingIntent.getBroadcast(this, 0, intent, PendingIntent.FLAG_IMMUTABLE);} else { alarmIntent = PendingIntent.getBroadcast(this, 0, intent, 0);}
来源地址:https://blog.csdn.net/loveseal518/article/details/131301899
--结束END--
本文标题: Android 12 以上PendingIntent使用注意FLAG_IMMUTABLE
本文链接: https://www.lsjlt.com/news/422667.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-01-21
2023-10-28
2023-10-28
2023-10-27
2023-10-27
2023-10-27
2023-10-27
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0