gpt4 book ai didi

android - Intent.ACTION_OPEN_DOCUMENT 在 Android Q 中不起作用

转载 作者:行者123 更新时间:2023-12-05 08:12:41 25 4
gpt4 key购买 nike

我尝试附上一些照片(或其他!文档),这些照片是通过手机相机(或其他!应用程序 - 用于创建文档)制作的。如果我运行下面的代码来选择照片,我没有看到它们:

Screenshot from the App

如果我打开 android 文件资源管理器 - 照片存在:

Screenshot directly from android file explorer

其他文件夹的情况与最近的情况相同,请参阅附件屏幕:

Screenshot from the App 2

Screenshot directly from android file explorer 2

看起来我没有足够的权限 - 但我还需要什么权限才能使用 Android Q??

如果我使用 6.0 到 9.0 之后的任何其他 Android 版本 - 那么一切都很好!我可以浏览并选择我想要的所有文件。

Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
intent.setType("*/*");
startActivityForResult(intent,requestCode);

附注DCIM\Camera 文件夹请看附件截图:

Screenshot directly from android file explorer 3

Screenshot directly from android file explorer 4

最佳答案

你试过 ACTION_GET_CONTENT

关于android - Intent.ACTION_OPEN_DOCUMENT 在 Android Q 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58282103/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com