James
James

Reputation: 14101

How to find if a phone is in sleep mode or not???

I want my application to run all time. It should execute a function when phone is in sleep mode and stop the execution when it is asleep. Can anyone post a sample code?

Thanks in advance.

Upvotes: 0

Views: 823

Answers (1)

hunterp
hunterp

Reputation: 15976

I think you need to look into WakeLocks http://developer.android.com/reference/android/os/PowerManager.WakeLock.html

Upvotes: 1

Related Questions