Jon*_*ira 4 notifications android android-notifications notification-channel
将通知频道设置为在锁屏不显示通知后,它仍然在锁屏上显示通知。
notificationChannel.setLockscreenVisibility(Notification.VISIBILITY_SECRET);
notificationManager.createNotificationChannel(notificationChannel);
Run Code Online (Sandbox Code Playgroud)
但是在创建频道后我可以调试它,看到通知频道没有将lockScreenVisibility设置为VISIBILITY_SECRET(-1),它仍然具有默认值,即-1000。
notificationChannel.getLockscreenVisibility()
Run Code Online (Sandbox Code Playgroud)
有谁知道如何设置锁屏可见性不显示在锁屏上?或者知道为什么它没有被更新?
还有一个信息是我之前已经创建了频道。但是我已经使用 VISIBILITY_SECRET 删除并重新创建了频道。
当您删除并重新创建频道时,所有以前的设置都将恢复。如果您想更改频道名称或描述以外的任何内容,您必须创建一个全新的频道(使用不同的频道 ID)或完全卸载/重新安装该应用程序。
| 归档时间: |
|
| 查看次数: |
5617 次 |
| 最近记录: |