public void switchAdapter( final SQLiteDatabase db, final IDBAdapter oldAdapter, final IDBAdapter newAdapter) { final Map<String, BookSettings> bookSettings = oldAdapter.getAllBooks(); oldAdapter.deleteAll(); oldAdapter.onDestroy(db); newAdapter.onCreate(db); newAdapter.restoreBookSettings(bookSettings.values()); }
@Override public Map<String, BookSettings> getAllBooks() { return adapter.getAllBooks(); }