I use [[UIScreen mainScreen]setBrightness: ] (in sdk 5.0) to change the system background light in my app.
The following steps work with my app:
Act
Have you tried registering your main view controller (or whatever object as to that) for the UIApplicationWillResignActiveNotification
which is sent after executing applicationWillResignActive
?
This will give you a chance to modify the brightness outside of applicationWillResignActive
. Don't know if this method makes any difference, but trying it should be easy.
Simply call:
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appWillResign) name:UIApplicationWillResignActiveNotification object:nil];
then define:
- (void)appWillResign {
[[NSUserDefaults standardUserDefaults] floatForKey:@"sysBright"];
[[UIScreen mainScreen] setBrightness:sysBright];
}