mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2025-06-05 21:59:19 +02:00
allow setting the editor app as default, fix #164
This commit is contained in:
@ -87,10 +87,9 @@ fun Activity.openWith(file: File) {
|
|||||||
fun Activity.openEditor(file: File) {
|
fun Activity.openEditor(file: File) {
|
||||||
val intent = Intent(Intent.ACTION_EDIT)
|
val intent = Intent(Intent.ACTION_EDIT)
|
||||||
intent.setDataAndType(Uri.fromFile(file), "image/*")
|
intent.setDataAndType(Uri.fromFile(file), "image/*")
|
||||||
val chooser = Intent.createChooser(intent, getString(R.string.edit_image_with))
|
|
||||||
|
|
||||||
if (intent.resolveActivity(packageManager) != null) {
|
if (intent.resolveActivity(packageManager) != null) {
|
||||||
startActivityForResult(chooser, REQUEST_EDIT_IMAGE)
|
startActivityForResult(intent, REQUEST_EDIT_IMAGE)
|
||||||
} else {
|
} else {
|
||||||
toast(R.string.no_editor_found)
|
toast(R.string.no_editor_found)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user