void () { synchronized (myScheduledUpdates) { for (Update each : getAllScheduledUpdates()) { try { each.setRejected(); } catch (ProcessCanceledException ignored) { } } myScheduledUpdates.clear(); finishActivity(); } }