I’m trying to use the enableWriteAheadLogging on my database, I’m implementing in the DatabaseHelper onCreate method, although I’ve tried calling elsewhere. I always get the error, java.lang.NoSuchMethodError and the app crashes.
@Override
public void onCreate(SQLiteDatabase db) {
//The create statements work fine, but
//I have tried putting the enable call first
for(int i=0; i<CREATE_TABLES.length; i++){
db.execSQL(CREATE_TABLES[i]);
}
for(int i=0; i<INSERT_DATA.length; i++){
db.execSQL(INSERT_DATA[i]);
}
//Always crashes, but db works fine if I comment out
db.enableWriteAheadLogging();
}
That method was added with API 11. My guess is that your project is built with an older version of the SDK. Thus that method doesn’t exist in the context of your application.