Merge pull request #3076 from jmakovicka/fix-sqlite-mode
Fix SQLite open flags
This commit is contained in:
commit
cafb244a90
1 changed files with 3 additions and 2 deletions
|
@ -14,8 +14,9 @@ public class SQLiteAPIImpl implements SQLiteAPI {
|
|||
|
||||
@Override
|
||||
public SQLiteConnection getOrCreateDatabase(String name, boolean readOnly) {
|
||||
android.database.sqlite.SQLiteDatabase db = app.openOrCreateDatabase(name,
|
||||
readOnly? SQLiteDatabase.OPEN_READONLY : (SQLiteDatabase.OPEN_READWRITE | SQLiteDatabase.ENABLE_WRITE_AHEAD_LOGGING), null);
|
||||
android.database.sqlite.SQLiteDatabase db = SQLiteDatabase.openDatabase(app.getDatabasePath(name).getAbsolutePath(), null,
|
||||
(readOnly? SQLiteDatabase.OPEN_READONLY : (SQLiteDatabase.OPEN_READWRITE | SQLiteDatabase.ENABLE_WRITE_AHEAD_LOGGING))
|
||||
| SQLiteDatabase.CREATE_IF_NECESSARY);
|
||||
if(db == null) {
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue