开发者

Re-enable the idle timer prior to app crashing out or user hitting the main exit button?

开发者 https://www.devze.com 2023-03-12 12:03 出处:网络
I am 开发者_如何转开发writing an app that disables the idle timer. How do I re-enable it prior to app crashing out or user hitting the main exit button? This could be real bad by draining the battery

I am 开发者_如何转开发writing an app that disables the idle timer. How do I re-enable it prior to app crashing out or user hitting the main exit button? This could be real bad by draining the battery otherwise.


You can reenable it in the - (void)applicationWillResignActive:(UIApplication *)application method.

You can use this: [[UIApplication sharedApplication] setIdleTimerDisabled:NO]. Don't forget to disable it again when your app becomes active.

0

精彩评论

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