开发者

android idle time

开发者 https://www.devze.com 2023-02-23 07:41 出处:网络
I want to make an application which when it is on \"idle state\" it must stop d开发者_运维技巧oing something. Application enters in idle when user doesn\'t interact with the application for a number o

I want to make an application which when it is on "idle state" it must stop d开发者_运维技巧oing something. Application enters in idle when user doesn't interact with the application for a number of seconds (ex. 50). Are there some android classes for this or how to do this in a simpler way?


Application enters in idle when user doesn't interact with the application for a number of seconds (ex. 50)

There is no built-in concept of "idle" in Android, other than the device going into sleep mode. You can watch for ACTION_SCREEN_OFF broadcast Intents, but that will be for the whole system, not just your application.


If you have no "background" task processing, you really have to understand the Android Activity lifecycle. You don't have to care about your application going "idle". You have to always keep in mind that your application can be put to sleep by the system AT ANY TIME.

Really read carefully the developer guide.

0

精彩评论

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