Is there any way to force device not to sleep, if my app is shown on the screen? Does manifest.xml have a special attribute for this?
Asked
Active
Viewed 72 times
2 Answers
0
Try this in your activity:
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
or use tag in manifest
android:keepScreenOn="true"
Emil
- 2,745
- 19
- 24
Misha Akopov
- 11,071
- 26
- 66
- 81
0
add this tag to your manifest file under activity tag android:keepScreenOn="true"
shaikhmanzoor
- 104
- 1
- 9