Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Repository {
- public void deleteAllExcursions() {
- databaseExecutor.execute(() -> {
- mexcursionDAO.deleteAllExcursions();
- });
- }
- public void deleteAllVacations() {
- databaseExecutor.execute(() -> {
- mvacationDAO.deleteAllVacations();
- });
- }
- }
- public interface ExcursionDAO {
- @Query("DELETE FROM excursion")
- void deleteAllExcursions();
- }
- public interface VacationDAO {
- @Query("DELETE FROM vacations")
- void deleteAllVacations();
- }
- public class VacationActivity extends AppCompatActivity {
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- clearAllExcursions();
- clearAllVacations();
- }
- private void clearAllExcursions() {
- repository = new Repository(getApplication());
- repository.deleteAllExcursions();
- Log.d("VacationActivity", "All excursions cleared.");
- }
- private void clearAllVacations() {
- repository = new Repository(getApplication());
- repository.deleteAllVacations();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement