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..