I have read solution from Failed to change locale for db '/data/data/my.easymedi.controller/databases/EasyMediInfo.db' to 'en_US' but it doesnt help me. I st
I couldn't put all these codes in the comments, so please try these: Keep in mind that I am not adding all the boilerplates... ok?
Change checkDb method:
private boolean checkDataBase(){
File dbFile = new File( DATABASE_PATH, DATABASE_NAME );
return dbFile.exists();
}
Change createDb method:
public void createDataBase() {
if(checkDb()){
//do nothing
} else {
copyDatabase();
}
}
Change copyDatabase() method:
private void copyDataBase(){
getReadableDatabase();
//add the rest of your current implementation
}
Change accessibility of your constructor to private and add these methods:
private DBHelper mInstance = null;
public static DBHelper getInstance(Context context) {
if(mInstance == null)
mInstance = new DBHelper(context)
return mInstance;
}
//remove the old openDatabase method
public SQLiteDatabase openDatabase() {
return getReadableDatabase(); //or you can use getWritableDatabase();
}
Besides I noticed that your db version in the posted code is 18 while in the logs that you posted it's saying 5 or 6? Can you post the latest logs...