Search in sources :

Example 1 with NotificationHelper

use of net.osmand.plus.NotificationHelper in project Osmand by osmandapp.

the class NotificationDismissReceiver method onReceive.

@Override
public void onReceive(Context context, Intent intent) {
    final NotificationHelper helper = ((OsmandApplication) context.getApplicationContext()).getNotificationHelper();
    String notificationTypeStr = intent.getExtras().getString(NOTIFICATION_TYPE_KEY_NAME);
    if (!Algorithms.isEmpty(notificationTypeStr)) {
        try {
            NotificationType notificationType = NotificationType.valueOf(notificationTypeStr);
            helper.onNotificationDismissed(notificationType);
        } catch (Exception e) {
        // ignored
        }
    }
}
Also used : OsmandApplication(net.osmand.plus.OsmandApplication) NotificationHelper(net.osmand.plus.NotificationHelper) NotificationType(net.osmand.plus.notifications.OsmandNotification.NotificationType)

Aggregations

NotificationHelper (net.osmand.plus.NotificationHelper)1 OsmandApplication (net.osmand.plus.OsmandApplication)1 NotificationType (net.osmand.plus.notifications.OsmandNotification.NotificationType)1