public void resetDatabase ( ) { String dropOrphanedEvents = "DROP TABLE IF EXISTS " + DbOrphanedEvent . TABLE_NAME ; SQLiteDatabase writable = dbHelper . getWritableDatabase ( ) ; writable . beginTransaction ( ) ; try { writable . execSQL ( dropOrphanedEvents ) ; writable . execSQL ( DatabaseHelper . SQL_CREATE_ORPHANED_EVENTS_TABLE ) ; writable . setTransactionSuccessful ( ) ; } finally { writable . endTransaction ( ) ; log . d ( "Chat database reset." ) ; } }
Recreates empty database .