如何删除旧的通知渠道? [英] How to remove old notification channels?

查看:280
本文介绍了如何删除旧的通知渠道?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序现在有3个通知渠道,我想删除其中2个.
我以为只要不注册2个频道就可以解决问题,但是当我在Android设备上打开通知设置时,旧的频道仍然会出现.
是否可以删除它们? 他们没有用,会使用户感到困惑.

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.

推荐答案

通知频道一旦创建便会永久保留.

Notification channels stay forever once they are created.

要再次删除它们,只需调用 在NotificationManager上,并带有您要删除的频道的ID:

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

notificationManager.deleteNotificationChannel("channel_id");

这篇关于如何删除旧的通知渠道?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆