通知日期变更 [英] notify the date change

查看:54
本文介绍了通知日期变更的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是黑莓开发的新手.我的要求就像我想每天早上8点执行特定任务.为此,我尝试了Timer类来安排上午8点的任务.但是问题是,如果我更改设备时间,则计时器将从那一刻起停止工作.因此,我移至RealtimeClockListener,但用户对电池耗电问题有不好的经验.

I am new to the blackberry development. My requirement is like I want to execute specific task on 8 a.m. every day. For this I tried Timer class to schedule task on 8 am. But the problem is if I change my device time, the timer stops working from that moment. So I moved to RealtimeClockListener but user had bad experience with the battery drain problem.

我只是想尝试一种有效的解决方案,但我在这里完全不被运气打扰.

I am just trying to work out with the efficient solution but no luck I am totally strucked here.

在这方面有人可以帮助我吗?我想执行一项任务,该任务每天早上8点执行..

Can anybody please help me in this regard. I want to implement a task which will execute on 8 am everyday..

请帮助我....

先谢谢您.

推荐答案

Blackberry在系统范围内发布了某些全局事件.感兴趣的应用程序可以通过实现GlobalEventListener并向UiApplication(或Application,如果您的应用程序在没有UI的后台运行)注册,以注册这些事件.

Blackberry posts certain global events system wide. Interested applications can register for these events by implementing GlobalEventListener and registering with UiApplication (or Application, if your app runs in background without UI).

您需要注意的事件是日期更改"和时区更改",详细说明

The event you will need to watch for are "Date Changed" and "Timezone Changed", elaborated here. And then adjust your timer accordingly.

这篇关于通知日期变更的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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