*Deleting a notification channel*
- delete notification channels by calling `deleteNotificationChannel()` - Notification settings displays the number of deleted channels, as a spam prevention mechanism. You can clear test channels on development devices: either by reinstalling the app, or by clearing the data associated with your copy of the app. - The following sample code demonstrates how to delete a notification channel:
``` {code: java } NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); // The id of the channel. String id = "my_channel_01"; NotificationChannel mChannel = mNotificationManager.getNotificationChannel(id); mNotificationManager.deleteNotificationChannel(mChannel); ``` {code} |
|