I’m trying to develop a very simple application that displays as a slide show with images that I’m sure I don’t understand (if anyone has any tips, it’s very much appreciated), but what they are interested in is to prevent the device from switching to sleep if his left bike is through these images?
using
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
will make a screen on which the lock will be disabled. Remove it using
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
Add android:keepScreenOn="true" to some widget in the activity layout XML file. While the action is in the foreground, the device does not fall asleep.
android:keepScreenOn="true"
You will use tracking lock.
http://developer.android.com/reference/android/os/PowerManager.WakeLock.html
Source: https://habr.com/ru/post/1434847/More articles:File archive and stub usage - phpConstructor of type "Track_Attack.TAGeneric" not found. C # Winforms - c #Auto-scan at the bottom of the page, then top and repeat - jqueryExt.log function is an empty function - javascriptHow can I (if at all) disable device hibernation in Trigger.io? - trigger.ioSearch Sunspot by id - solrUsing the Game Center player identifier in the PFUser object being analyzed? - iosHow to include more request urls in a session cookie path in Tomcat? - javaHow to put the result of a stored procedure into a table variable? - variablesHow to open StreamReader in ShareDenyWrite mode? - c #All Articles