这是错误:
android.database.sqlite.SQLiteException: attempt to write a readonly database
这是我的代码:
SQLiteDatabase db = mDatabase.getWritableDatabase();
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();
}
答案 0 :(得分:0)
我已经解决了这个问题。我刚刚缩短了表名。就是这样。