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