Skip to content

Commit

Permalink
refactor: extract string to constant
Browse files Browse the repository at this point in the history
  • Loading branch information
aitorvs committed Dec 17, 2015
1 parent cfcea76 commit 65ada8b
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
public class AllowMe {

private static final String TAG = AllowMe.class.getSimpleName();
private static final String ALLOWME_SHOULD_SHOW_PRIMING_KEY = TAG + ".key.should_show_priming";
private static AllowMe instance;

private Activity mActivity;
Expand Down Expand Up @@ -314,10 +315,10 @@ private void requestPermission(int requestCode) {

public boolean shouldShowPrimingMessage() {
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(safeActivity());
boolean value = sharedPreferences.getBoolean("should_show_priming", true);
boolean value = sharedPreferences.getBoolean(ALLOWME_SHOULD_SHOW_PRIMING_KEY, true);

// we've been called, set it to false again
sharedPreferences.edit().putBoolean("should_show_priming", false).apply();
sharedPreferences.edit().putBoolean(ALLOWME_SHOULD_SHOW_PRIMING_KEY, false).apply();

return value;
}
Expand Down

0 comments on commit 65ada8b

Please sign in to comment.