mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-07-30 17:48:50 +02:00
fix(dialog): use parsed MIME type for Android save dialog (#3519)
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user