Skip to content

Commit 588a046

Browse files
author
Jan Guegel
committed
adjusted toast in try catch in storage permission action
Signed-off-by: Jan Guegel <[email protected]>
1 parent 2a5026e commit 588a046

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

app/src/main/kotlin/org/fossify/filemanager/activities/SimpleActivity.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package org.fossify.filemanager.activities
22

33
import android.annotation.SuppressLint
44
import android.content.Intent
5-
import android.net.Uri
65
import android.os.Environment
76
import android.provider.Settings
87
import org.fossify.commons.activities.BaseSimpleActivity
@@ -13,6 +12,7 @@ import org.fossify.commons.extensions.toast
1312
import org.fossify.commons.helpers.PERMISSION_WRITE_STORAGE
1413
import org.fossify.commons.helpers.isRPlus
1514
import org.fossify.filemanager.R
15+
import androidx.core.net.toUri
1616

1717
open class SimpleActivity : BaseSimpleActivity() {
1818
override fun getAppIconIDs() = arrayListOf(
@@ -82,10 +82,10 @@ open class SimpleActivity : BaseSimpleActivity() {
8282
try {
8383
val intent = Intent(Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION)
8484
intent.addCategory("android.intent.category.DEFAULT")
85-
intent.data = Uri.parse("package:$packageName")
85+
"package:$packageName".toUri().also { intent.data = it }
8686
startActivityForResult(intent, MANAGE_STORAGE_RC)
8787
} catch (e: Exception) {
88-
showErrorToast(e)
88+
toast(R.string.no_storage_permissions)
8989
val intent = Intent()
9090
intent.action = Settings.ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION
9191
startActivityForResult(intent, MANAGE_STORAGE_RC)

0 commit comments

Comments
 (0)