Last active
March 20, 2020 00:46
-
-
Save sinadalvand/886ad20883e764dd3d560f81bac2f4da to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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