In a snackbar action, how can I be sure it's safe to permanently delete a soft-deleted record from the database?
I am using Snackbar in android and I have implemented an action so that user can undo the action (the action is clearing all the items in the listview).Removing and adding the items back to the listview has already been done and working fine. My issue is that, items are stored in sqlite database and how can I delete the items from tables? (How can I know that the user has not clicked the undo button, so that I can completely remove the data from database). This is the code inside OnOptionsItemSelcted() case R.id.action_clear: final List<Word> temp = new ArrayList<Word>(data); data.clear();