notify the date change

2019-08-10 05:50发布

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..

标签: blackberry
1条回答
2楼-- · 2019-08-10 06:51

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.

查看更多
登录 后发表回答