Skip to content

Commit

Permalink
Refactored code for sharedPref, removed unnecessary handled exception
Browse files Browse the repository at this point in the history
  • Loading branch information
sacOO7 committed Feb 5, 2024
1 parent 08ddfd5 commit 379081c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public int get(String key, int defaultValue) {
}

@Override
public void clear(Field[] fields) {
public void clear(String[] keys) {
hashMap = new HashMap<>();
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,7 @@ public int get(String key, int defaultValue) {
public void clear(String[] keys) {
SharedPreferences.Editor editor = activationContext.getPreferences().edit();
for (String key : keys) {
try {
editor.remove(key);
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
}
editor.remove(key);
}
editor.commit();
}
Expand Down

0 comments on commit 379081c

Please sign in to comment.