You want to use something like this:
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
More Related Contents:
- How can you make a custom keyboard in Android? [closed]
- How to retrieve the android sdk version? [duplicate]
- How do I create a circular (endless) RecyclerView?
- Navigation Drawer semi-transparent over status bar not working
- Manifest merger failed targeting Android 12 [duplicate]
- What does ellipsize mean in android?
- Finish parent and current activity in Android
- Shared Preferences “limit”
- How to add a gesture detector to a view in Android
- Crashlytics Android SDK – custom UncaughtExceptionHandler
- MPAndroid Chart not displaying any labels for xAxis , what is missing?
- Using FFmpeg with Android-NDK
- Offline mode for Android app using the Google Maps API
- java.lang.StackOverFlow error. Suspected too many views?
- cordova – Error: Failed to fetch platform android
- When should one use RxJava Observable and when simple Callback on Android?
- Android: Total height of ScrollView
- How to import a .aar file into Android Studio 1.1.0 and use it in my code
- Back to main activity from notification-created activity
- How to count app usage time while app is on foreground?
- No Creators, like default construct, exist): cannot deserialize from Object value (no delegate- or property-based Creator
- Overriding the power button in Android
- how to make my viewpager swipe from right to left
- Creating Custom Overlay on the map
- WiFi Direct (Android 4.0) with multiple (3+) devices
- Quick fix for NetworkOnMainThreadException
- Android, how do I stop a pointer appearing below an EditText
- Can I draw outside the bounds of an Android Canvas
- Text color of a closed spinner
- Kotlin: open new Activity inside of a Fragment