static synchronized SQLiteDatabase getDatabase ( ) { if ( sInstance == null ) { throw new SprinklesNotInitializedException ( ) ; } if ( sDatabase == null ) { DbOpenHelper dbOpenHelper = new DbOpenHelper ( sInstance . mContext , sInstance . databaseName , sInstance . initialDatabaseVersion ) ; sDatabase = dbOpenHelper . getWritableDatabase ( ) ; } return sDatabase ; }
Throws SprinklesNotInitializedException if you try to access the database before initializing Sprinkles .