Search code examples
androidandroid-intentscreenbroadcast

Turn on screen on device


How can I turn the sceen on ?

I tried something like this

adb -d  shell am broadcast -a android.intent.action.SCREEN_ON

It really should work, I send broadcast intent it is received by the system, but the screen doesn't turn on

I do not understand what is the problem, is it possible to turn the screen of the device by code ? I mean with software ? Cause it seems like the turning on of the screen is done just by the hardware button press . . . at least I got that felling , am I wrong ?


Solution

  • I could be wrong about this, but...

    You shouldn't think of broadcasts as something to send to get things done, but instead think of them as things that are sent when things are done.

    I think the system sends 'android.intent.action.SCREEN_ON' when screen is goes on, but sending 'android.intent.action.SCREEN_ON' does not necessarily make the screen go on.

    I hope this makes sense.

    For the answer, you can find it in...