fix(dialog): use parsed MIME type for Android save dialog (#3519)

This commit is contained in:
purvsinojiya-inventyv
2026-07-29 17:05:43 +02:00
committed by GitHub
parent dc7f87bc7e
commit cc9ec9b4ad
2 changed files with 10 additions and 3 deletions
+6
View File
@@ -0,0 +1,6 @@
---
"dialog": patch
"dialog-js": patch
---
Fix Android save dialog MIME type when a single MIME type is provided.
@@ -204,9 +204,10 @@ class DialogPlugin(private val activity: Activity): Plugin(activity) {
val intent = Intent(Intent.ACTION_CREATE_DOCUMENT)
intent.addCategory(Intent.CATEGORY_OPENABLE)
intent.putExtra(Intent.EXTRA_TITLE, args.fileName ?: "")
intent.type = "*/*"
if (parsedTypes.isNotEmpty()) {
if (parsedTypes.size == 1) {
intent.type = parsedTypes.first()
} else {
intent.type = "*/*"
intent.putExtra(Intent.EXTRA_MIME_TYPES, parsedTypes)
}