开发者

attempt to write a readonly database in Android2.1

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜