Skip to content

Instantly share code, notes, and snippets.

@sinadalvand
Last active March 20, 2020 00:46
Show Gist options
  • Save sinadalvand/886ad20883e764dd3d560f81bac2f4da to your computer and use it in GitHub Desktop.
Save sinadalvand/886ad20883e764dd3d560f81bac2f4da to your computer and use it in GitHub Desktop.
private void channelMaker() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
NotificationChannel serviceChannel = new NotificationChannel(
ChannelID,
"Dowload Channel",
NotificationManager.IMPORTANCE_DEFAULT
);
NotificationManager manager = getSystemService(NotificationManager.class);
manager.createNotificationChannel(serviceChannel);
}
}
new NotificationCompat.Builder(this, ChannelID)
.setContentTitle("Downloader")
.setContentText(contentText)
.setSmallIcon(R.drawable.ic_baseline_cloud_download_24)
.build();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment