How to disable power button?

Lukap picture Lukap · Nov 7, 2011 · Viewed 40.3k times · Source

Is it possible to override the functionality of the android power button ? I want to 'disable' the power button. My plan is to override the functionality of this button to do nothing ( {}; ) Well my main idea is to disable the turning the screen off.

I want when someone press the power button nothing to happen.

How can I do this ?

Answer

CommonsWare picture CommonsWare · Nov 7, 2011

Is it possible to override the functionality of the android power button ? I want to 'disable' the power button.

Fortunately, this is not possible, except perhaps via custom firmware.