I have an application that uses a camcorder, so the screen cannot be dim. Screen inhibition from dimming works like this:
- (void)applicationDidBecomeActive:(UIApplication *)application
{
[[UIApplication sharedApplication] setIdleTimerDisabled:YES];
}
However, when the application is closed and enters the background, setting IdleTimer back to NO does not work. The screen remains forever on the main screen. This is how I try to do it.
- (void)applicationWillResignActive:(UIApplication *)application
{
[[UIApplication sharedApplication] setIdleTimerDisabled:NO];
}
Is there a better place to add this line of code?
source
share