Skip to content

Commit 22b331e

Browse files
committed
use the new way of intent handling at opening files
1 parent bcf7369 commit 22b331e

File tree

1 file changed

+1
-6
lines changed
  • app/src/main/kotlin/com/simplemobiletools/filemanager/pro/extensions

1 file changed

+1
-6
lines changed

app/src/main/kotlin/com/simplemobiletools/filemanager/pro/extensions/Activity.kt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import android.app.Activity
44
import android.content.Intent
55
import android.net.Uri
66
import androidx.core.content.FileProvider
7-
import com.simplemobiletools.commons.R
87
import com.simplemobiletools.commons.activities.BaseSimpleActivity
98
import com.simplemobiletools.commons.extensions.*
109
import com.simplemobiletools.commons.helpers.isNougatPlus
@@ -29,11 +28,7 @@ fun Activity.tryOpenPathIntent(path: String, forceChooser: Boolean, openAsType:
2928
action = Intent.ACTION_VIEW
3029
setDataAndType(uri, getMimeTypeFromUri(uri))
3130
addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
32-
if (resolveActivity(packageManager) != null) {
33-
startActivity(this)
34-
} else {
35-
toast(R.string.no_app_found)
36-
}
31+
launchActivityIntent(this)
3732
}
3833
} else {
3934
openPath(path, forceChooser, openAsType)

0 commit comments

Comments
 (0)