android - 将 PDF 保存在 Android 11 上的外部下载目录中

标签 android storage android-11 scoped-storage

在 android 11 中引入了作用域存储。根据保存非媒体文件(如 PDF)的文档,应使用存储访问框架。因此,使用存储访问框架的用户需要使用系统文件选择器选择位置来保存非媒体文件 (PDF)。但是如果您在 android 11 上使用 whatsapp 应用程序并尝试保存 PDF 文件,它永远不会要求用户选择位置。默认情况下,它将pdf文件保存到外部文档目录。
我想在我的应用程序中复制相同的行为。有人可以在这里指导我。

最佳答案

你必须访问我给出的这些问题的答案
couldn't attach file send email android 11
从这些链接中,您必须获取文件提供程序代码请添加这些代码以存储您的文件
https://acomputerengineer.com/2018/09/06/create-pdf-and-save-to-the-sdcard-in-android/

关于android - 将 PDF 保存在 Android 11 上的外部下载目录中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67006892/

相关文章:

android - 查找 admob 的电话哈希设备 ID

mysql - BIT(1) 的存储大小是多少?

php - Laravel 媒体存储最佳实践

Android:如何使用带有 ExoPlayer 的 MediaStore 打开视频文件?

android - 无法从 Android 中的另一个类调用自定义绘制方法

android - Android中如何限制mp3文件在其他应用程序中播放

git - Github 或任何其他基于云的存储库服务(Gitlab、Bitbucket)如何存储源代码文件和目录?

android - 当应用程序目标为 (Android 11/API 30) 或更高版本时,如何将文件保存在 android 的根文件夹中?

android-download-manager - 安卓 : why am I not able to open pdf downloaded from DownloadManager inside public Download/myfolder directory in Android 11?

java - 参数错误 : BadParametersError: Parameters were incorrect. 我们希望在运行 Appium 时在 Selenium 网格上具有所需的功能