开发者

iPhone/Android SDK , detect when in sleep/standby

How can I tell when my app is open and the user use the power button to shut the display, or the iPhone shuts the display on its own ?

what I need to do, is wait for an event, then figure out if the screen 开发者_如何学编程is off and wake the screen with an alert.

actually, I need this to work on both the iPhone and Android versions of my app

I'll appreciate any insight for both platforms

thanks


For iphone I think you are talking about lock state. If yes then you can use this methods

- (void)applicationWillResignActive:(UIApplication *)application
- (void)applicationDidBecomeActive:(UIApplication *)application
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜