-
- private void update_accounts(boolean force) {
- long now = new Date().getTime();
- if ((now > (account_list_last_updated + (24 * 3600 * 1000))) || force) {
- Log.d("db",
- "accounts last updated at " + account_list_last_updated + " and now is " + now +
- ". re-fetching");
- update_accounts();
- }
- }
-
- private void update_accounts() {
- RetrieveAccountsTask task = new RetrieveAccountsTask(new WeakReference<>(mActivity));
-
- task.setPref(PreferenceManager.getDefaultSharedPreferences(mActivity));
- task.execute();
-
- }
- private void update_account_table() {
- if (this.getContext() == null) return;
-
- model.scheduleAccountListReload(this.getContext());
- }
- public void onShowOnlyStarredClicked(MenuItem mi) {
- SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(mActivity);
- boolean flag = pref.getBoolean(PREF_KEY_SHOW_ONLY_STARRED_ACCOUNTS, false);
-
- SharedPreferences.Editor editor = pref.edit();
- editor.putBoolean(PREF_KEY_SHOW_ONLY_STARRED_ACCOUNTS, !flag);
- Log.d("pref", "Setting show only starred accounts pref to " + (flag ? "false" : "true"));
- editor.apply();
-
- update_account_table();
- }
-