String channelId = "1";
String channelName = "channel_name";
NotificationChannel channel = new NotificationChannel(channelId,channelName,NotificationManager.IMPORTANCE_HIGH);
NotificationManager manager = (NotificationManager)this.getSystemService(this.NOTIFICATION_SERVICE);
manager.createNotificationChannel(channel);
Notification notification = new NotificationCompat.Builder(this)
.setTicker(resources.getString(R.string.new_pictures_title))
.setSmallIcon(android.R.drawable.ic_menu_report_image)
.setContentTitle(resources.getString(R.string.new_pictures_title))
.setContentText(resources.getString(R.string.new_pictures_text))
.setChannelId(channelId)
.setContentIntent(pi)
.setAutoCancel(true)
.build();
// NotificationManagerCompat notificationManagerCompat = NotificationManagerCompat.from(this);
manager.notify(0,notification);