How to remove old notification channels?

筅森魡賤 提交于 2019-12-22 03:51:15

问题


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.


回答1:


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");


来源:https://stackoverflow.com/questions/51801940/how-to-remove-old-notification-channels

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!