notify the date change

空扰寡人 提交于 2019-12-24 16:59:49

问题


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.

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

Please help me....

Thanking you in advance..


回答1:


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.



来源:https://stackoverflow.com/questions/8265388/notify-the-date-change

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!