1

I want to dispatch key event for Power button programatically.I tried following line of code but its not working..

dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN,KeyEvent.KEYCODE_POWER));

But this is not working..

Any help on this most welcome..

dave.c
  • 10,910
  • 5
  • 39
  • 62
Ashiq Sayyad
  • 111
  • 2
  • 5

1 Answers1

1

This is not possible, without custom modification to your firmware or the core of the Android operating system, for a limited number of devices.

Refer this LINK for more details about POWER button event.

Community
  • 1
  • 1
Shankar Agarwal
  • 34,573
  • 7
  • 66
  • 64