aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/com/zeapo
diff options
context:
space:
mode:
authorHarsh Shandilya <msfjarvis@gmail.com>2020-06-14 07:54:46 +0000
committerGitHub <noreply@github.com>2020-06-14 13:24:46 +0530
commitcd72d15b328cce62d0a6162533bd868222824f75 (patch)
tree0dad0cf4bab178131581c4d6a3d151db53742185 /app/src/main/java/com/zeapo
parent5aab4088d1697317c8c77e3565a7b0605a21b53f (diff)
UserPreference: delete all shortcuts when repository is deleted (#850)
Diffstat (limited to 'app/src/main/java/com/zeapo')
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/UserPreference.kt5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/UserPreference.kt b/app/src/main/java/com/zeapo/pwdstore/UserPreference.kt
index 04967c82..cd01c883 100644
--- a/app/src/main/java/com/zeapo/pwdstore/UserPreference.kt
+++ b/app/src/main/java/com/zeapo/pwdstore/UserPreference.kt
@@ -232,6 +232,11 @@ class UserPreference : AppCompatActivity() {
// TODO Handle the different cases of exceptions
}
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) {
+ requireContext().getSystemService<ShortcutManager>()?.apply {
+ removeDynamicShortcuts(dynamicShortcuts.map { it.id }.toMutableList())
+ }
+ }
sharedPreferences.edit { putBoolean("repository_initialized", false) }
dialogInterface.cancel()
callingActivity.finish()