pull/921/head
gedoor 4 years ago
parent 41ecea7232
commit e827cfd7fb
  1. 4
      app/src/main/java/io/legado/app/lib/permission/PermissionActivity.kt

@ -13,7 +13,7 @@ import io.legado.app.utils.toastOnUi
class PermissionActivity : AppCompatActivity() { class PermissionActivity : AppCompatActivity() {
private val startSettingActivity = private val settingActivityResult =
registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { registerForActivityResult(ActivityResultContracts.StartActivityForResult()) {
RequestPlugins.sRequestCallback?.onSettingActivityResult() RequestPlugins.sRequestCallback?.onSettingActivityResult()
finish() finish()
@ -37,7 +37,7 @@ class PermissionActivity : AppCompatActivity() {
-> try { -> try {
val settingIntent = Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS) val settingIntent = Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS)
settingIntent.data = Uri.fromParts("package", packageName, null) settingIntent.data = Uri.fromParts("package", packageName, null)
startSettingActivity.launch(settingIntent) settingActivityResult.launch(settingIntent)
} catch (e: Exception) { } catch (e: Exception) {
toastOnUi(R.string.tip_cannot_jump_setting_page) toastOnUi(R.string.tip_cannot_jump_setting_page)
finish() finish()

Loading…
Cancel
Save