在Android的特定日期和时间运行活动 [英] run activity at particular date and time in Android
问题描述
怎么可以安排特别的活动在特定数据库中的日期和时间字段?
how can i schedule particular activity to run at particular DATE and TIME fields of database?
例如某人的生日发送电子邮件自动..
for example send email on someone's birthday automatically..
希望一些code片段。
hope for some code snippet.
-
谢谢
-- Thanks
推荐答案
您正在寻找一个服务。它是在后台运行,并且不需要用户交互的活动。
You are looking for a Service. It is an activity that runs in the background and doesn't require user interaction.
您可以有服务检查数据库的日常并将其与当前的日期再发送一封电子邮件,如果它是正确的日期。
You can have the Service check the db everyday and compare it to the current date then send an email if it is the correct date.
这说明服务的更多: http://developer.android.com/reference /android/app/Service.html
和这里是一个例子如何code带有计时器的服务:
and here is an example of how to code a service with a timer:
http://www.brighthub.com/mobile/google-安卓/用品/ 34861.aspx
古德勒克?
这篇关于在Android的特定日期和时间运行活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!