Support multiple file formats for upload

This commit is contained in:
Alex Abudaev 2026-04-05 16:37:45 +08:00
parent 1558ead809
commit 541b5c0672

View file

@ -112,7 +112,34 @@ class MainActivity : AppCompatActivity() {
} }
private fun openFilePicker() { private fun openFilePicker() {
filePickerLauncher.launch(arrayOf("application/pdf")) val mimeTypes = arrayOf(
"text/plain",
"text/markdown",
"text/csv",
"application/pdf",
"application/msword",
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"application/rtf",
"application/vnd.ms-excel",
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
"application/vnd.oasis.opendocument.spreadsheet",
"application/vnd.ms-powerpoint",
"application/vnd.openxmlformats-officedocument.presentationml.presentation",
"image/png",
"image/jpeg",
"image/webp",
"image/gif",
"application/x-python",
"application/javascript",
"application/java",
"application/json",
"application/xml",
"text/yaml",
"text/html",
"text/css",
"application/zip"
)
filePickerLauncher.launch(mimeTypes)
} }
private fun loadUrlFromIntent() { private fun loadUrlFromIntent() {