admin管理员组文章数量:1391981
I would like to be able to open a file picker for .fb2
files, but I am not able to find the mime type.
val launcher = rememberLauncherForActivityResult(
contract = ActivityResultContracts.OpenDocument(),
onResult = { uri ->
handleEvent(ImportScreenEvent.Import(uri))
}
)
launcher.launch(
arrayOf(
"application/pdf",
"text/plain",
"application/epub+zip",
"text/fb2+xml",
"application/x-fb2",
"aapplication/x-zip-compressed-fb2",
"application/fb2+zip",
"application/fb2.zip",
"application/fb2",
"application/fictionbook2+zip",
"application/fictionbook3+zip"
)
)
I would like to be able to open a file picker for .fb2
files, but I am not able to find the mime type.
val launcher = rememberLauncherForActivityResult(
contract = ActivityResultContracts.OpenDocument(),
onResult = { uri ->
handleEvent(ImportScreenEvent.Import(uri))
}
)
launcher.launch(
arrayOf(
"application/pdf",
"text/plain",
"application/epub+zip",
"text/fb2+xml",
"application/x-fb2",
"aapplication/x-zip-compressed-fb2",
"application/fb2+zip",
"application/fb2.zip",
"application/fb2",
"application/fictionbook2+zip",
"application/fictionbook3+zip"
)
)
Share
Improve this question
asked Mar 14 at 22:06
BPDevBPDev
9177 silver badges22 bronze badges
1 Answer
Reset to default 1According to Wikipedia, your latter two (application/fictionbook2+zip
and application/fictionbook3+zip
) are valid MIME types. However, Android only knows of a small subset of the possible MIME types and their file extension associations Requesting MIME types outside of that subset will not work and will give you the results that you see in your question. There is nothing that you can do about this.
本文标签: androidMime type of fb2 filesStack Overflow
版权声明:本文标题:android - Mime type of .fb2 files - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744630544a2616511.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论