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()");
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();