简体   繁体   English

Android通知会在一段时间后消失

[英]Android Notifications disappear after some time

Android notifications disappear after some time, without touching it to cancel. 一段时间后,Android通知会消失,而无需触摸即可取消。 What could cause this kind of problem? 什么会引起这种问题? The notification is started in a Service. 通知在服务中启动。 Is that possible that the low memory causes this kind of problem? 内存不足可能导致这种问题吗?

Make sure that there is no any other service or project module, which does the following call NotificationManager.cancelAll() to cancel all the notifications. 确保没有任何其他服务或项目模块,该服务或项目模块执行以下调用NotificationManager.cancelAll()来取消所有通知。 It is always better to keep the notifications controller over Unique ID and cancel only the notifications which are related to that part, by this the code won't touch the notifications posted by other project parts. 始终使通知控制器保持唯一标识,并仅取消与该部分相关的通知总是更好的方法,因此,该代码不会触及其他项目部分发布的通知。

NotificationManager documentation. NotificationManager文档。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 单击后Android通知不会消失 - Android notifications does not disappear after click 在我的 flutter(android) 应用程序中 - Firebase 推送通知在一段时间后停止为每个用户接收 - In my flutter(android) app - Firebase push notifications stop receiving after some time for every user 使用React Native图像会在重新加载应用程序一段时间后消失 - With React Native images disappear after some time when app is reloaded 推送通知会在某些设备上经过很长时间后到达 - Push notifications arrive after a long time on some devices Android:使View在定义的时间后消失的最佳方法 - Android: best way to make a View disappear after a defined amount of time 几个小时后如何重复android通知 - How to repeat android notifications after some Interval of hours 一段时间后android后台服务停止 - android background service stops after some time 一段时间后如何在Android中开始活动? - How to start activity after some time in Android? Android-一段时间后终止意图 - Android - Kill intent after some period of time Android,文件夹删除一段时间后 - Android, folder deleted after some time
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM