Skip to content

Instantly share code, notes, and snippets.

View SubhrajyotiSen's full-sized avatar

Subhrajyoti Sen SubhrajyotiSen

View GitHub Profile
val notificationManager: NotificationManagerCompat =
NotificationManagerCompat.from(context)
val channel: NotificationChannelCompat? =
notificationManager.getNotificationChannelCompat(channelId)
@Nullable
public NotificationChannelCompat getNotificationChannelCompat(@NonNull String channelId) {
if (Build.VERSION.SDK_INT >= 26) {
NotificationChannel channel = getNotificationChannel(channelId);
if (channel != null) {
return new NotificationChannelCompat(channel);
}
}
return null;
}