Fix crashes
This commit is contained in:
@@ -110,11 +110,7 @@ class ServicesSettingsFragment : BasePreferenceFragment(R.string.services),
|
||||
if (account == null) {
|
||||
am.addAccount(accountType, accountType, null, null, requireActivity(), null, null)
|
||||
} else {
|
||||
try {
|
||||
startActivity(SyncSettingsIntent(account))
|
||||
} catch (_: ActivityNotFoundException) {
|
||||
Snackbar.make(listView, R.string.operation_not_supported, Snackbar.LENGTH_SHORT).show()
|
||||
}
|
||||
startActivitySafe(SyncSettingsIntent(account))
|
||||
}
|
||||
true
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ class AboutSettingsFragment : BasePreferenceFragment(R.string.about) {
|
||||
private fun openLink(url: String, title: CharSequence?) {
|
||||
val intent = Intent(Intent.ACTION_VIEW)
|
||||
intent.data = url.toUri()
|
||||
startActivity(
|
||||
startActivitySafe(
|
||||
if (title != null) {
|
||||
Intent.createChooser(intent, title)
|
||||
} else {
|
||||
|
||||
@@ -84,14 +84,14 @@ class TrackerSettingsFragment :
|
||||
Build.VERSION.SDK_INT >= Build.VERSION_CODES.O -> {
|
||||
val intent = Intent(Settings.ACTION_APP_NOTIFICATION_SETTINGS)
|
||||
.putExtra(Settings.EXTRA_APP_PACKAGE, requireContext().packageName)
|
||||
startActivity(intent)
|
||||
startActivitySafe(intent)
|
||||
true
|
||||
}
|
||||
|
||||
channels.areNotificationsDisabled -> {
|
||||
val intent = Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS)
|
||||
.setData(Uri.fromParts("package", requireContext().packageName, null))
|
||||
startActivity(intent)
|
||||
startActivitySafe(intent)
|
||||
true
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user