From 9b793afd72aaea77223c8c3c48e479299f307a0d Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 6 Nov 2017 18:17:47 +0100 Subject: [PATCH] handle all third party intents like on nougat --- .../com/simplemobiletools/commons/extensions/Activity.kt | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Activity.kt b/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Activity.kt index 7c0853dba..4ac17c54d 100644 --- a/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Activity.kt +++ b/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Activity.kt @@ -165,10 +165,7 @@ fun Activity.openEditor(uri: Uri, applicationId: String) { action = Intent.ACTION_EDIT setDataAndType(newUri, getMimeTypeFromUri(newUri)) addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION) - - if (isNougatPlus()) { - putExtra(MediaStore.EXTRA_OUTPUT, uri) - } + putExtra(MediaStore.EXTRA_OUTPUT, uri) if (resolveActivity(packageManager) != null) { startActivityForResult(this, REQUEST_EDIT_IMAGE) @@ -190,9 +187,7 @@ fun Activity.openFile(uri: Uri, forceChooser: Boolean, applicationId: String) { putExtra(IS_FROM_GALLERY, true) } - if (isNougatPlus()) { - putExtra(REAL_FILE_PATH, uri) - } + putExtra(REAL_FILE_PATH, uri) if (resolveActivity(packageManager) != null) { val chooser = Intent.createChooser(this, getString(R.string.open_with))