Skip to content

Commit

Permalink
Added methods to reset specific and all usage ids.
Browse files Browse the repository at this point in the history
  • Loading branch information
dhavalwooplr committed Mar 7, 2017
1 parent c800c7e commit 3d5ce3e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1257,4 +1257,27 @@ private static int getSoftButtonsBarHeight(Activity activity) {
}
return 0;
}

/**
* This will remove all usage ids from preferences.
*/
public void resetAllUsageIds(){
try{
preferencesManager.resetAll();
}catch(Exception e){
e.printStackTrace();
}
}

/**
* This will remove given usage id from preferences.
* @param id Spotlight usage id to be removed
*/
public void resetUsageId(String id){
try{
preferencesManager.reset(id);
}catch(Exception e){
e.printStackTrace();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public void setDisplayed(String id) {
}

public void reset(String id) {
sharedPreferences.edit().putBoolean(id, false).apply();
sharedPreferences.edit().remove(id).apply();
}

public void resetAll() {
Expand Down

0 comments on commit 3d5ce3e

Please sign in to comment.