0

Is it possible in an acitvity override the callback called when the power button is pressed? My target is to prevent the screen off.

I found this - How to hook into the Power button in Android? -but it seems don't work.

THX

Community
  • 1
  • 1
UrTe
  • 51
  • 1
  • 5

1 Answers1

0

You can keep the screen on with a wake lock: http://developer.android.com/reference/android/os/PowerManager.html

But you should be carefull with it because it really drains the battery.

dbrettschneider
  • 3,173
  • 1
  • 29
  • 28