3

I didn't find it anywhere, how can I handle entering sleeping mode in android? I want to do something when android device entered to the sleep mode? Is this possible or is there anyway to handle it?

favo
  • 5,426
  • 9
  • 42
  • 61
Savas Adar
  • 4,083
  • 3
  • 46
  • 54

2 Answers2

2

Just make this by using BroadCastReceivers for system-calls (wakeup/sleep)

Android - how to receive broadcast intents ACTION_SCREEN_ON/OFF?

Community
  • 1
  • 1
berlindev
  • 1,753
  • 14
  • 22
  • 4
    Technically, these are not related to sleep mode. The device may stay awake for a bit after `ACTION_SCREEN_OFF` is broadcast. Similarly, the device may be on without the screen being on. However, they *are* the closest broadcasts related to "sleep mode" events. – CommonsWare Aug 15 '11 at 12:09
2

how can I handle entering sleeping mode in android?

Generally, you don't. There is nothing you need to do related to sleep mode.

I want to do something when android device entered to the sleep mode?

I certainly hope not.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491