]> git.ktnx.net Git - mobile-ledger-staging.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/App.java
whitespace
[mobile-ledger-staging.git] / app / src / main / java / net / ktnx / mobileledger / App.java
index 051a17c308540ac2b15dc2cd15e997207361b746..b6ae697f355409d9b1256b05b57174427d4b598b 100644 (file)
@@ -26,6 +26,7 @@ import android.preference.PreferenceManager;
 
 import net.ktnx.mobileledger.model.Data;
 import net.ktnx.mobileledger.utils.Globals;
+import net.ktnx.mobileledger.utils.Logger;
 import net.ktnx.mobileledger.utils.MobileLedgerDatabase;
 
 import static net.ktnx.mobileledger.ui.activity.SettingsActivity.PREF_KEY_SHOW_ONLY_STARRED_ACCOUNTS;
@@ -33,8 +34,14 @@ import static net.ktnx.mobileledger.ui.activity.SettingsActivity.PREF_KEY_SHOW_O
 public class App extends Application {
     public static App instance;
     private MobileLedgerDatabase dbHelper;
+    public static SQLiteDatabase getDatabase() {
+        if (instance == null) throw new RuntimeException("Application not created yet");
+
+        return instance.getDB();
+    }
     @Override
     public void onCreate() {
+        Logger.debug("flow", "App onCreate()");
         instance = this;
         super.onCreate();
         updateMonthNames();
@@ -51,6 +58,7 @@ public class App extends Application {
     }
     @Override
     public void onTerminate() {
+        Logger.debug("flow", "App onTerminate()");
         if (dbHelper != null) dbHelper.close();
         super.onTerminate();
     }
@@ -59,11 +67,6 @@ public class App extends Application {
         super.onConfigurationChanged(newConfig);
         updateMonthNames();
     }
-    public static SQLiteDatabase getDatabase() {
-        if (instance == null) throw new RuntimeException("Application not created yet");
-
-        return instance.getDB();
-    }
     public SQLiteDatabase getDB() {
         if (dbHelper == null) initDb();