Skip to content Skip to sidebar Skip to footer

Unable To Open Database File (code 14): , While Compiling: Pragma Journal_mode

Here is what I am doing in my DatabaseHelper class. public DatabaseHelper(Context context) { super(context, DATABASENAME, null, VERSION); context.openOrCreateDa

Solution 1:

I found what was wrong with my code. I was initialising TableHelper class in other helper classes' constructor and that was calling DatabaseHelper's onCreate again so that was making it lock the database.

Removed TableHelper initialisation from the other TableHelper's constructor and put it in method where it was needed.

Thank you.

Solution 2:

Remove the

context.openOrCreateDatabase(DATABASENAME, context.MODE_PRIVATE, null);

You're using SQLiteOpenHelper and it does the database file management for you.

Post a Comment for "Unable To Open Database File (code 14): , While Compiling: Pragma Journal_mode"