From 4dd24557af8d6e2925843a2f68ec7602394eca75 Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Wed, 2 Jan 2019 20:44:30 +0000 Subject: [PATCH] use a constant for the last refresh stamp option --- .../ui/account_summary/AccountSummaryFragment.java | 4 ++-- app/src/main/java/net/ktnx/mobileledger/utils/MLDB.java | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/account_summary/AccountSummaryFragment.java b/app/src/main/java/net/ktnx/mobileledger/ui/account_summary/AccountSummaryFragment.java index 2d494af9..99cf91fe 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/account_summary/AccountSummaryFragment.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/account_summary/AccountSummaryFragment.java @@ -154,7 +154,7 @@ public class AccountSummaryFragment extends Fragment { } private void prepare_db() { - account_list_last_updated = MLDB.get_option_value("last_refresh", (long) 0); + account_list_last_updated = MLDB.get_option_value(MLDB.OPT_LAST_REFRESH, (long) 0); } private void update_accounts(boolean force) { @@ -182,7 +182,7 @@ public class AccountSummaryFragment extends Fragment { Snackbar.make(swiper, err_text, Snackbar.LENGTH_LONG).show(); } else { - MLDB.set_option_value("last_refresh", new Date().getTime()); + MLDB.set_option_value(MLDB.OPT_LAST_REFRESH, new Date().getTime()); update_account_table(); } } diff --git a/app/src/main/java/net/ktnx/mobileledger/utils/MLDB.java b/app/src/main/java/net/ktnx/mobileledger/utils/MLDB.java index c11ea848..443e0a9a 100644 --- a/app/src/main/java/net/ktnx/mobileledger/utils/MLDB.java +++ b/app/src/main/java/net/ktnx/mobileledger/utils/MLDB.java @@ -45,6 +45,7 @@ public final class MLDB { public static final String ACCOUNTS_TABLE = "accounts"; public static final String DESCRIPTION_HISTORY_TABLE = "description_history"; public static final String OPT_TRANSACTION_LIST_STAMP = "transaction_list_last_update"; + public static final String OPT_LAST_REFRESH = "last_refresh"; private static MobileLedgerDatabase helperForReading, helperForWriting; private static Context context; private static void checkState() { -- 2.39.5