Skip to content

Commit 88100ea

Browse files
committed
allow importing both txt and json files
1 parent 03d0ea8 commit 88100ea

File tree

1 file changed

+3
-1
lines changed
  • app/src/main/kotlin/com/simplemobiletools/notes/pro/activities

1 file changed

+3
-1
lines changed

app/src/main/kotlin/com/simplemobiletools/notes/pro/activities/MainActivity.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,9 +649,11 @@ class MainActivity : SimpleActivity() {
649649
} else {
650650
Intent(Intent.ACTION_OPEN_DOCUMENT).apply {
651651
addCategory(Intent.CATEGORY_OPENABLE)
652-
type = "text/*"
652+
type = "*/*"
653653

654654
try {
655+
val mimetypes = arrayOf("text/*", "application/json")
656+
putExtra(Intent.EXTRA_MIME_TYPES, mimetypes)
655657
startActivityForResult(this, PICK_OPEN_FILE_INTENT)
656658
} catch (e: ActivityNotFoundException) {
657659
toast(R.string.system_service_disabled, Toast.LENGTH_LONG)

0 commit comments

Comments
 (0)