cesarferreira
cesarferreira

Reputation: 1588

Android service stops collecting data when the screen is turned off

So I have a service that logs ProximitySensor data.

It all works fine when I have the screen ON, but like 5 seconds after the screen goes OFF the log stops.

How can I keep my Android service running when the screen is turned off?

Upvotes: 1

Views: 1884

Answers (1)

Dave
Dave

Reputation: 4291

You need a partial wake lock, but it will eat the battery like candy.

Upvotes: 4

Related Questions