问题
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