Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep instance variables and prefs in sync. #98

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,8 @@ private static void clearSharedPreferences(Context context) {
editor.remove(KEY_INSTALL_DATE);
editor.remove(KEY_LAUNCH_TIMES);
editor.apply();
mLaunchTimes = 0;
mInstallDate.setTime(0);
}

/**
Expand Down Expand Up @@ -355,10 +357,12 @@ private static void storeInstallDate(final Context context, SharedPreferences.Ed
* @param context
*/
private static void storeAskLaterDate(final Context context) {
long currentTime = System.currentTimeMillis();
SharedPreferences pref = context.getSharedPreferences(PREF_NAME, Context.MODE_PRIVATE);
Editor editor = pref.edit();
editor.putLong(KEY_ASK_LATER_DATE, System.currentTimeMillis());
editor.putLong(KEY_ASK_LATER_DATE, currentTime);
editor.apply();
mAskLaterDate.setTime(currentTime);
}

/**
Expand Down