You can get the active notification list from the NotificationManager.
public boolean isNotificationActive(int notificationId) { NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); StatusBarNotification[] barNotifications = notificationManager.getActiveNotifications(); for(StatusBarNotification notification: barNotifications) { if (notification.getId() == notificationId) { return true; } } return false; }
source share