我正在尝试使用我的 Android 应用(设置 -> 设备 -> 存储管理 -> 外部存储首选项)在 Chromebook 中打开特定的设置页面。
我的应用程序读取/写入 USB 驱动器,我需要确保它已启用。如果启用此功能,一切正常,但我需要一种简单的方法将用户指向此设置。
如果我在 Chrome 浏览器中打开 chrome://os-settings/storage/externalStoragePreferences,它会将我带到正确的设置。
我尝试使用在浏览器中打开:
val uri = Uri.parse("http://chrome://ossettings/storage/externalStoragePreferences")
val browserIntent = Intent(Intent.ACTION_VIEW, uri)
startActivity(browserIntent)
这会出现“无法访问站点”错误。
如果我尝试不使用 http - 仅使用 chrome://ossettings/storage/externalStoragePreferences 作为 uri,则会收到以下错误:
java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.VIEW dat=chrome://os-settings/storage/externalStoragePreferences cmp=org.chromium.arc.intent_helper/.OpenChromeMultideviceSettingsActivity } from ProcessRecord{cc19980 19710:com.simplifieditproducts.picturekeeperconnect/u0a69} (pid=19710, uid=10069) requires com.google.android.apps.multidevice.client.permission.INITIALIZE_SCAN
这是我第一次使用 Chrome 操作系统,似乎没有很多可用的文档。任何帮助将不胜感激!