java – block screen "wipe" for inactivity


My app works as a guide for a professional illuminator, it works passively (responds via Bluetooth to user commands in their work tool) or offline where the user can manually operate it in parallel with their tool, the question is that on both occasions the user would spend a long time without interacting with the application, however reading its data constantly, it is essential that the screen does not turn off or darken, I know that the user can very well set this manually, but I wanted to within the application.

I searched on Google but it only appears nonsense, talking about an app to save battery and etc, the problem is that the keywords are the same as several doubts of lay users.

I searched the site but couldn't find anything here.

I looked on Google's Developers, but because I don't know English very well, and because their explanation isn't very intuitive, I didn't get any constructive results. Can someone help me?


Try putting this in your Activity 's onCreate


Or inside your layout:

<RelativeLayout xmlns:android=""

If you want to read more about:

I hope it helps!

Scroll to Top