我怎么知道Android SAF的特定哑剧类型?
我想使用Android Storage Access Framework的 .asf ) /shared/documents-files#create-file“ rel =“ nofollow noreferrer”> action_create_document 。我应该通过哪种MIME类型来支持至少默认的Android文件管理器并保存在文件存储上?一些更常见的扩展(例如 .hex
)怎么样?
如果我不通过类型
完全:
fun saveFile(fromFile: File, fileName: String, mimeType: String, resultCode: Int) {
inputFile = fromFile
val intent = Intent(Intent.ACTION_CREATE_DOCUMENT).apply {
addCategory(Intent.CATEGORY_OPENABLE)
if (mimeType.isNotEmpty()) {
type = mimeType
}
putExtra(Intent.EXTRA_TITLE, fileName)
}
context.startActivityForResult(intent, resultCode)
}
我得到:
android.content.content.activityNotFoundException,没有发现能够处理意图的活动{act = android.intent.create.create_document cat = [android.intent.category.category.openable](extras)(extras)},null)
)))))
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在这里更新
我列出了一个列表,以更好地理解
希望这将解决您的问题。
Update
here I made a list for a better understanding
hope this will solve your problem.