mirror of
https://github.com/SimpleMobileTools/Simple-File-Manager.git
synced 2025-02-17 04:10:39 +01:00
use the new way of intent handling at opening files
This commit is contained in:
parent
bcf7369816
commit
22b331e535
@ -4,7 +4,6 @@ import android.app.Activity
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import androidx.core.content.FileProvider
|
||||
import com.simplemobiletools.commons.R
|
||||
import com.simplemobiletools.commons.activities.BaseSimpleActivity
|
||||
import com.simplemobiletools.commons.extensions.*
|
||||
import com.simplemobiletools.commons.helpers.isNougatPlus
|
||||
@ -29,11 +28,7 @@ fun Activity.tryOpenPathIntent(path: String, forceChooser: Boolean, openAsType:
|
||||
action = Intent.ACTION_VIEW
|
||||
setDataAndType(uri, getMimeTypeFromUri(uri))
|
||||
addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
|
||||
if (resolveActivity(packageManager) != null) {
|
||||
startActivity(this)
|
||||
} else {
|
||||
toast(R.string.no_app_found)
|
||||
}
|
||||
launchActivityIntent(this)
|
||||
}
|
||||
} else {
|
||||
openPath(path, forceChooser, openAsType)
|
||||
|
Loading…
x
Reference in New Issue
Block a user