|
|
@ -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() |
|
|
|