]> git.ktnx.net Git - mobile-ledger.git/commitdiff
use a constant for the last refresh stamp option
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Wed, 2 Jan 2019 20:44:30 +0000 (20:44 +0000)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Wed, 2 Jan 2019 20:44:30 +0000 (20:44 +0000)
app/src/main/java/net/ktnx/mobileledger/ui/account_summary/AccountSummaryFragment.java
app/src/main/java/net/ktnx/mobileledger/utils/MLDB.java

index 2d494af98afac869e725faa1dcf8fd63a2b47459..99cf91fecb07e32024878114560836dbbd90a0cf 100644 (file)
@@ -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();
         }
     }
index c11ea8486182839e89c3667ee23d5acc82e1aea8..443e0a9a5bdc2eedffeb3e55472d798c2be8065d 100644 (file)
@@ -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() {