Unity Android(十) 适配Android14系统

开发环境:Unity2019.4 Android14平板 AndroidStudio2020.3.1

本文仅作个人记录,方便后续回顾。

请求权限 MANAGE_EXTERNAL_STORAGE

参考链接:https://blog.csdn.net/qq_34765850/article/details/136045431

cs 复制代码
将应用更新为以 Android 11 为目标平台后,您将无法使用requestLegacyExternalStorage,而且也没有其他标记可以提供停用分区存储。

所有文件访问权限 MANAGE_EXTERNAL_STORAGE,用来获取所有文件的管理权限。


<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />

val intent = Intent()
intent.action= Settings.ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION
startActivity(intent)

//判断是否获取MANAGE_EXTERNAL_STORAGE权限:
val isHasStoragePermission= Environment.isExternalStorageManager()

不需要 WRITE_EXTERNAL_STORAGE READ_EXTERNAL_STORAGE

若判断是否有读写权限,则返回false

在此感谢这篇文章作者 https://blog.csdn.net/qq_34765850/article/details/136045431

相关推荐
不吃凉粉20 小时前
Android Studio USB串口通信
android·ide·android studio
zhangphil20 小时前
android studio设置大内存,提升编译速度
android·android studio
编程乐学21 小时前
安卓非原创--基于Android Studio 实现的天气预报App
android·ide·android studio·课程设计·大作业·天气预报·安卓大作业
大熊的瓜地1 天前
Android automotive 框架
android·android car
私人珍藏库1 天前
[Android] Alarm Clock Pro 11.1.0一款经典简约个性的时钟
android·时钟
消失的旧时光-19431 天前
ScheduledExecutorService
android·java·开发语言
小糖学代码1 天前
MySQL:14.mysql connect
android·数据库·mysql·adb
怪兽20141 天前
请谈谈什么是同步屏障?
android·面试
帅锅锅0071 天前
SeLinux 全面详解
android·linux
只想搞钱的肥仔1 天前
Android thermal (5)_cooling device(下)
android