5.6 C
New York
Monday, November 27, 2023

Keep Screen Stay Awake in Android App

How to keep the screen on/ screen awake in Android Application.

This tutorial explains how to keep the screen on/ screen awake in Android Application. Sometimes when any application needs to wake up the screen or the CPU, therefore, needs to keep it awake to complete some work.

Please follow the steps below in order to keep the screen on/ screen awake Android application:

1.Open Android studio.

2.Go to MainActivity.java and add the code

getWindow(). addFlags (WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)

3. By doing this, the display will never go off when your application is running in the device.

Related Articles

Latest Articles