开发者

Determine time since last user activity in Android

开发者 https://www.devze.com 2023-01-19 11:02 出处:网络
How do you discover when, in the future, the device is 开发者_JS百科expected to sleep? Or, at least, when the last user activity was?

How do you discover when, in the future, the device is 开发者_JS百科expected to sleep?

Or, at least, when the last user activity was?


How do you discover when, in the future, the device is expected to sleep?

You don't. There is no API for this. The device will go to sleep after the user-specified timeout has elapsed and after all outstanding WakeLocks are released. It is impossible to predict when the device will go to sleep, since the OS has no idea when those WakeLocks will be released.

0

精彩评论

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

关注公众号