Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove old notification channels?

Tags:

My app now has 3 notification channels, I want to remove 2 of them.
I thought simply not registering 2 channels would do the trick but when I open the notification settings on the Android device, the old channels still appear.
Is it possible to remove them? They have no use and can confuse the users.

like image 854
SagiLow Avatar asked Aug 11 '18 17:08

SagiLow


People also ask

What is a notification channel in Android?

What Are Notification Channels? Notification channels enable us app developers to group our notifications into groups—channels—with the user having the ability to modify notification settings for the entire channel at once.

How do I manage multiple notifications on Android?

Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project. Step 2 − Add the following code to res/layout/activity_main. xml.

What are notification categories?

Notification categories are an Android Oreo (8.0+) feature which gives users finer control over notifications. When the user receives a notification with a category they can long press on it or go into the Notification Settings to change the category's settings.


1 Answers

Notification channels stay forever once they are created.

To remove them again, simply call deleteNotificationChannel() on the NotificationManager with the ID of the channel you want to delete:

notificationManager.deleteNotificationChannel("channel_id");
like image 92
Floern Avatar answered Oct 21 '22 11:10

Floern