开发者

How to place a kill safe alarm fired on daily basis?

开发者 https://www.devze.com 2023-01-02 07:05 出处:网络
开发者_运维百科I know how to setup an alarm to fire repeatedly, but the alarm stops firing after my application is killed.
开发者_运维百科

I know how to setup an alarm to fire repeatedly, but the alarm stops firing after my application is killed.

How do I make sure the alarm continues to fire as it was setup?


You can automatically restart your closed app Activity after a few seconds using the OneShotAlarm approach described at

http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/OneShotAlarm.html

using a scheduled app (re)launch.


If you try to kill the integrated clock application, you'll see the alarm doesn't ring anymore (I had the problem with my HTC Desire).

That's because you can't keep any observer when the application is killed.
So you can't place any kill safe alarm.

0

精彩评论

暂无评论...
验证码 换一张
取 消