我正在尝试在我的 Android 10 (API 29) 设备上获得MANAGE_EXTERNAL_STORAGE权限。
https://developer.android.com/training/data-storage/manage-all-files
显现:
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
Run Code Online (Sandbox Code Playgroud)
主要活动:
Intent intent = new Intent(Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION);
startActivity(intent);
Run Code Online (Sandbox Code Playgroud)
结果是:
No Activity found to handle Intent { act=android.settings.MANAGE_APP_ALL_FILES_ACCESS_PERMISSION }
Run Code Online (Sandbox Code Playgroud)
好的,这种行为是可能的。医生说:
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
Run Code Online (Sandbox Code Playgroud)
但是我怎样才能获得那个许可呢?
我使用 DownloadManager 下载照片并将其保存到外部图片目录:
.setDestinationInExternalPublicDir(Environment.DIRECTORY_PICTURES, File.separator + filename)
Run Code Online (Sandbox Code Playgroud)
Marshmallow 需要 WRITE_EXTERNAL_STORAGE(如预期),但在 Android Q 及更高版本上,它无需许可即可正常工作。为什么会这样?是因为范围存储吗?
android android-permissions android-download-manager android-external-storage scoped-storage
我需要用斯威夫特CPU温度,但我不能找到除了任何信息这.
我认为我应该使用IOKit.framework,但是没有太多关于它的信息.