mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-04-20 18:27:26 +02:00
allow importing both txt and json files
This commit is contained in:
parent
03d0ea826b
commit
88100ea5ae
@ -649,9 +649,11 @@ class MainActivity : SimpleActivity() {
|
|||||||
} else {
|
} else {
|
||||||
Intent(Intent.ACTION_OPEN_DOCUMENT).apply {
|
Intent(Intent.ACTION_OPEN_DOCUMENT).apply {
|
||||||
addCategory(Intent.CATEGORY_OPENABLE)
|
addCategory(Intent.CATEGORY_OPENABLE)
|
||||||
type = "text/*"
|
type = "*/*"
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
val mimetypes = arrayOf("text/*", "application/json")
|
||||||
|
putExtra(Intent.EXTRA_MIME_TYPES, mimetypes)
|
||||||
startActivityForResult(this, PICK_OPEN_FILE_INTENT)
|
startActivityForResult(this, PICK_OPEN_FILE_INTENT)
|
||||||
} catch (e: ActivityNotFoundException) {
|
} catch (e: ActivityNotFoundException) {
|
||||||
toast(R.string.system_service_disabled, Toast.LENGTH_LONG)
|
toast(R.string.system_service_disabled, Toast.LENGTH_LONG)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user