0

Possible Duplicate:
Force Screen On

I need block the save power of device when my app is runs. No problem if screen goes down (my app is an audio app). I read about power manager and I discover this (that keep screen on). How disallow save power to device when my app runs?

getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
Community
  • 1
  • 1
Max Asura
  • 821
  • 1
  • 7
  • 13

1 Answers1

1

You will need to carefully use a partial WakeLock, as is discussed in the PowerManager documentation. acquire() it when your audio starts playing, and release() it when the audio stops.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491