如何设置报警 [英] How to set alarm

查看:150
本文介绍了如何设置报警的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何机构可以告诉我如何设置警报?我有一个时间选择器,但每一次,当我杀了我的申请时间也与当前的系统时间进行更新。

Can any body tell me how to set the alarm? I have one time picker but every time when I kill my application time is also updating with current system time.

推荐答案

您应该使用的 AlarmManager 了解这一点。看<一href="http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/AlarmService.html"相对=nofollow>这里一个例子。

You should use AlarmManager for that. Look here for an example.

在文档(以上链接)的例子就足够了。使用 sql.Date ,以获得实际的日期从SQL并将其转换为毫秒设置报警。

The example in the docs (link above) should be sufficient. Use sql.Date to get the actual date from the sql and convert it to milliseconds to set the alarm.

这篇关于如何设置报警的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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