-1
寫只讀數據庫這是錯誤:企圖的Android2.1
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();
}
什麼是'mDatabase'?數據庫位於何處?你的例外發生在哪條線上? – CommonsWare 2010-05-15 09:47:58