让5分钟后消失通知 [英] Make notification disappear after 5 minutes

查看:283
本文介绍了让5分钟后消失通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能作出通知的一段时间后自动消失?

Is it possible to make a notification automatically disappear after a period of time?

推荐答案

是的,你可以创建一个在五分钟后会超时并删除您的通知后台运行的服务。无论你应该做的实际上是为辩论。一个通知应该在那里通知用户......,用户应该能够关闭它自己。

Yeah, you can just create a service that runs in the background that'll timeout after five minutes and delete your notification. Whether you "should" actually do that is up for debate. A notification should be there to notify the user... and the user should be able to dismiss it on their own.

从d.android.com:

一个服务是可以执行长时间运行的应用程序组件
  在背景和操作不提供用户界面。

A Service is an application component that can perform long-running operations in the background and does not provide a user interface.

这篇关于让5分钟后消失通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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