PDA

View Full Version : How to detect when user presses sleep/wake button




tmeehan
Nov 6, 2009, 02:42 PM
Does anyone know if there is a way to detect or be notified when the user physically presses the sleep/wake button. I would like to take some power saving steps if I know the user specifically pressed the sleep button as opposed to the idle timer kicking in. Any clues would help tremendously. Thanks.



jeremy.king
Nov 6, 2009, 03:02 PM
Its in UIApplicationDelegate -
- applicationWillResignActive:
- applicationDidBecomeActive:

http://stackoverflow.com/questions/368014/awake-from-sleep-event-on-the-iphone