dothedos
dothedos

Reputation: 169

Persistent app. Device is not going to sleep while my app is running?

How can I make my device not going to sleep while my application is running, e.g gps is running? I know that might be battery consuming, but for the time being lets get past that.

Upvotes: 1

Views: 823

Answers (2)

kaspermoerch
kaspermoerch

Reputation: 16570

You could look into a combination of WAKE_LOCK permission and PowerManager.

Upvotes: 1

skynet
skynet

Reputation: 9908

This has been asked before:

Disabling screen sleep Programatically in Android?

use setKeepScreenOn(true).

Upvotes: 2

Related Questions