diff --git a/app/src/main/java/io/legado/app/lib/permission/PermissionActivity.kt b/app/src/main/java/io/legado/app/lib/permission/PermissionActivity.kt index b98b16fde..887ca158a 100644 --- a/app/src/main/java/io/legado/app/lib/permission/PermissionActivity.kt +++ b/app/src/main/java/io/legado/app/lib/permission/PermissionActivity.kt @@ -13,7 +13,7 @@ import io.legado.app.utils.toastOnUi class PermissionActivity : AppCompatActivity() { - private val startSettingActivity = + private val settingActivityResult = registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { RequestPlugins.sRequestCallback?.onSettingActivityResult() finish() @@ -37,7 +37,7 @@ class PermissionActivity : AppCompatActivity() { -> try { val settingIntent = Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS) settingIntent.data = Uri.fromParts("package", packageName, null) - startSettingActivity.launch(settingIntent) + settingActivityResult.launch(settingIntent) } catch (e: Exception) { toastOnUi(R.string.tip_cannot_jump_setting_page) finish()