private void startDelete(Task task) { pipe.remove( task.getId(), new Callback<Void>() { @Override public void onSuccess(Void data) { startRefresh(); } @Override public void onFailure(Exception e) { Toast.makeText( getActivity(), "Error removing task: " + e.getMessage(), Toast.LENGTH_LONG) .show(); } }); }
public void startRefresh() { pipe.getAll( tasks, new Callback<List<Task>>() { @Override public void onSuccess(List<Task> data) { adapter.notifyDataSetChanged(); } @Override public void onFailure(Exception e) { Toast.makeText( getActivity(), "Error refreshing tasks: " + e.getMessage(), Toast.LENGTH_LONG) .show(); } }); }