diff --git a/README.markdown b/README.markdown index 86a859a..210682d 100644 --- a/README.markdown +++ b/README.markdown @@ -22,7 +22,7 @@ If you are using the Gradle build system, simply add the following dependency in ```groovy dependencies { - implementation 'com.github.ranaparamveer:android-sqlite-asset-helper:v2.0.6' + implementation 'com.github.ranaparamveer:android-sqlite-asset-helper:v2.0.7' } ``` diff --git a/library/src/main/java/com/readystatesoftware/sqliteasset/SQLiteAssetHelper.java b/library/src/main/java/com/readystatesoftware/sqliteasset/SQLiteAssetHelper.java index 8883ccc..69864b7 100755 --- a/library/src/main/java/com/readystatesoftware/sqliteasset/SQLiteAssetHelper.java +++ b/library/src/main/java/com/readystatesoftware/sqliteasset/SQLiteAssetHelper.java @@ -439,6 +439,10 @@ private SQLiteDatabase returnDatabase() { Log.i(TAG, "successfully opened database " + mName); db = SQLiteDatabase.openDatabase(getDatabasePath(), mFactory, SQLiteDatabase.OPEN_READWRITE); }else if (createNewIfNotExist) { + File f = new File(mDatabasePath + "/"); + if (!f.exists()) { + f.mkdirs(); + } db = SQLiteDatabase.openOrCreateDatabase(getDatabasePath(), mFactory, new DatabaseErrorHandler() { @Override public void onCorruption(SQLiteDatabase sqLiteDatabase) {