如何在 Android 的共享表上显示默认文件应用程序?

问题描述

我正在开发一个笔记应用程序,我正在开发一个将其导出为 PDF 文档的功能

通过以下指南,我们实现了以 action.send 的形式发送到另一个应用程序的功能https://developer.android.com/guide/components/intents-filters

但是,Android 的认“文件”应用未显示在 android 共享表上。 我想实现通过 Android 的本机文件应用保存到设备的逻辑。

val intent = Intent()
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
intent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION)

intent.action = Intent.ACTION_SEND
intent.type = "*/*"

val uri = FileProvider.getUriForFile(context,context.packageName + ".sharefileprovider",sharedFile)
intent.putExtra(Intent.EXTRA_STREAM,uri)
val intentChooser = Intent.createChooser(intent,"ShareTest")
context.startActivity(intentChooser)

I want the Files app to be displayed on the Share sheet like this image.

有什么解决办法吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)