views:

175

answers:

1

This is the error:

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

This is my code:

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();
}
A: 

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

JoJo