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