Hello everyone,

Today I will give you a simple tip on how to keep your screen on While your application is running in android.
In Real devices the problem is you will loose some of the values in your variable when your device goes to sleep mode.
To prevent this what we can do is to prevent the phone from going to sleep mode.
To do this a simple thing needs to be done in your xml.

paste this in the root of your layout to keep the screen on.

android:keepScreenOn=”true”

Its really simple as that.

 

Leave a Reply

Your email address will not be published. Required fields are marked *

 

 

 

Theme by HermesThemes

Copyright © 2018 CoderzHeaven. All Rights Reserved

Please wait...

Subscribe to our newsletter

Want to be notified when our article is published? Enter your email address and name below to be the first to know.