]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/MobileLedgerApplication.java
stop closing acuired db handles and leave that for the application termination
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / MobileLedgerApplication.java
index 39d7e542d8f8a201d37f83e360b5153d41b72f7a..20762c07a9ee76b5c66db1d953ca8c5cf9f8f6eb 100644 (file)
@@ -23,6 +23,7 @@ import android.content.res.Resources;
 import android.os.Build;
 
 import net.ktnx.mobileledger.utils.Globals;
+import net.ktnx.mobileledger.utils.MLDB;
 
 public class MobileLedgerApplication extends Application {
 
@@ -30,6 +31,12 @@ public class MobileLedgerApplication extends Application {
     public void onCreate() {
         super.onCreate();
         updateColorValues();
+        MLDB.init(this);
+    }
+    @Override
+    public void onTerminate() {
+        MLDB.done();
+        super.onTerminate();
     }
     @Override
     public void onConfigurationChanged(Configuration newConfig) {
@@ -42,10 +49,14 @@ public class MobileLedgerApplication extends Application {
             Resources.Theme theme = getTheme();
             Globals.table_row_odd_bg = rm.getColor(R.color.table_row_odd_bg, theme);
             Globals.table_row_even_bg = rm.getColor(R.color.table_row_even_bg, theme);
+            Globals.primaryDark = rm.getColor(R.color.design_default_color_primary_dark, theme);
+            Globals.defaultTextColor = rm.getColor(android.R.color.tab_indicator_text, theme);
         }
         else {
             Globals.table_row_odd_bg = rm.getColor(R.color.table_row_odd_bg);
             Globals.table_row_even_bg = rm.getColor(R.color.table_row_even_bg);
+            Globals.primaryDark = rm.getColor(R.color.design_default_color_primary_dark);
+            Globals.defaultTextColor = rm.getColor(android.R.color.tab_indicator_text);
         }
     }
 }