public void scheduleAction() { updateValues(); NotificationBuilder builder = new NotificationBuilder(id, title, body); builder .setTicker(ticker) .setDefaults(flags) .setAlertOnlyOnce(alertOnce.isOn) .setDelay(delay * 1000) .setRepeating(repeating.isOn) .setAutoCancel(autoCancel.isOn) .setGroup(group) .setColor(color) .setSound("ses") .setInterval(interval * 1000); if (repeating.isOn && interval == 0) { AndroidNotifications.showToast("Enter interval"); } else { AndroidNotifications.scheduleNotification(builder.build()); AndroidNotifications.showToast("Notification scheduled"); } }
/// <summary> /// Cancels notification with current id /// </summary> public void cancelAction() { updateValues(); AndroidNotifications.cancelNotification(id); AndroidNotifications.showToast("Notification cancelled (" + id + ")"); }
/// <summary> /// Clear all notifications buttin action /// </summary> public void clearAll() { AndroidNotifications.clearAll(); AndroidNotifications.showToast("All cleared"); }
/// <summary> /// Clear current notification button id /// </summary> public void clearCurrent() { AndroidNotifications.clear(id); AndroidNotifications.showToast("Cleared id " + id); }