开发者

attempt to write a readonly database in Android2.1

开发者 https://www.devze.com 2022-12-30 14:38 出处:网络
This is the error: android.database.sqlite.SQLiteException: attempt to write a readonly database This is my code:

This is the error:

android.database.sqlite.SQLiteException: attempt to write a readonly database

This is my code:

SQLiteDatabase db = mDatabase.getWritabl开发者_JAVA技巧eDatabase();
db.beginTransaction();
try {
   // add new records
   ContentValues newRecord = new ContentValues();
   newRecord.put(Emergencydetails.EMERGENCYNUMBER, emergencyNumber.getText().toString());
   db.insert(Emergencydetails.EMERGENCY_TABLE_NAME, null, newRecord);
   db.setTransactionSuccessful();
} finally {
db.endTransaction();
}


I have solved this. I have just shortened the table name. That's it.

0

精彩评论

暂无评论...
验证码 换一张
取 消