Skip to content

Instantly share code, notes, and snippets.

Last active Apr 29, 2020
What would you like to do?
NotificationManager notificationManager =
(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
int notifyId = 1;
String channelId = "some_channel_id";
Notification notification = new Notification.Builder(MainActivity.this)
.setContentTitle("Some Message")
.setContentText("You've received new messages!")
notificationManager.notify(id, notification);
Copy link

ritikrishu commented Apr 13, 2018

Line number 10 should be setChannelId

Copy link

yikeLiuAde commented Apr 29, 2020

Hi, the notifyId is never used

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment