I am trying to develop an app that would do something after clicking the power button.
I have a code that catches the onClick of Power button, but it don't seem to work. The screen would lock.
Now I am trying to catch the onLongPress of the Power Button, preventing the "Power Off" options from appearing. Any suggestions on how to do that?
thanks in advance.