0

In my application i want add this feature .

After open the application before closing the application i don't want allow to go into the power saver mode of the device. How can i manage this. even user can't doing anything on the screen (even it is in idle). after closing my application allow to get power saver mode.

Edit i got the solution for this Query..

RajaReddy PolamReddy
  • 22,428
  • 19
  • 115
  • 166

2 Answers2

1

Use this keyword for your layout:

FLAG_KEEP_SCREEN_ON
sudo rm -rf
  • 29,408
  • 19
  • 102
  • 161
0

add this code

getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
RajaReddy PolamReddy
  • 22,428
  • 19
  • 115
  • 166