- public SQLiteDatabase getDB() {
- if (dbHelper == null)
- initDb();
-
- return dbHelper.getWritableDatabase();
- }
- private synchronized void initDb() {
- if (dbHelper != null)
- return;
-
- // Let Room do any possible migrations
- // this method may be removed when all DB access is made via Room
- DB.get()
- .compileStatement("select count(*) from profiles");
- dbHelper = new MobileLedgerDatabase(this);
- }