2

I am trying to make an app that turn your screen off when you clicked a button. I have read about this

PowerManager manager = (PowerManager) getSystemService(Context.POWER_SERVICE);
manager.goToSleep(int amountOfTime);

how do I achieve this? I am new in android studio so I am practicing this on my phone which also has a power button problem. Thankyou guys

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Marcanah
  • 43
  • 1
  • 6

0 Answers0