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;
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();
}
@Override
public void onTerminate() {
+ Logger.debug("flow", "App onTerminate()");
if (dbHelper != null) dbHelper.close();
super.onTerminate();
}
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();