简体   繁体   中英

how to know if UI is idle for X time?

I have a servery app. That ask questions from users. What I want to do. If user did not do any thing with UI for the 1 mint... Then I must terminate the server.

What should I do for this?

I know ACTION_SCREEN_OFF. This event actually called when screen time out. That may be 30 mint? depend on user setting. But let suppose user set time out for 30mint. and this event will call after 30 mint. But I want to know if UI is idle for 1 mint only.

通常,我在我的代码中安装SCREEN_OFF广播监听器(不是作为清单条目,只是一个动态监听器)...如果它被触发,那么我知道用户已经闲置,只要它们的定义“太长”。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM