在Android中的广播接收器中检测日期更改事件 [英] Detect day change event in broadcast receiver in android

查看:114
本文介绍了在Android中的广播接收器中检测日期更改事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在android应用程序中实现一项功能,即使我的应用程序没有运行,只要有日期更改(在00:00 AM时),该功能就会执行特定的代码。

I want to implement a feature in android app which execute a particular code when ever there is a date change(at 00:00AM) even when my app is not running.

推荐答案

我可能回答这个问题很晚,但是我个人也遇到了同样的问题。对于日期更改,您可以简单地将广播接收器与动作 android.intent.action.DATE_CHANGED一起使用,并且只要更改日期(由用户隐式或显式),它将触发。我希望这会对通过Google到达这里的人有所帮助。

I might be late answering this question, but I personally faced the same problem. For day change, you can simply use a broadcast receiver with action "android.intent.action.DATE_CHANGED", and it will trigger whenever the date is changed (either implicitly or explicitly by user). I hope this will help someone who gets to here through Google.

这篇关于在Android中的广播接收器中检测日期更改事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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