Buda Gavril
Buda Gavril

Reputation: 21647

android idle time

I want to make an application which when it is on "idle state" it must stop doing 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?

Upvotes: 0

Views: 2405

Answers (2)

Kevin Gaudin
Kevin Gaudin

Reputation: 9945

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.

Upvotes: 1

CommonsWare
CommonsWare

Reputation: 1006779

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.

Upvotes: 2

Related Questions