Support multiple file formats for upload
This commit is contained in:
parent
1558ead809
commit
541b5c0672
1 changed files with 28 additions and 1 deletions
|
|
@ -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() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue