Android Question service keeps screen on

jimseng

Active Member
Licensed User
Longtime User
Hello.
My service (receiving text messages) keeps the phone screen on, even after I call exitapplication. I am not using any phone libraries or explicitly altering the phone wake state. It happens on my nexus 5 and Galaxy s3. What might be the reason?
 

jimseng

Active Member
Licensed User
Longtime User
As far as I am aware I am not doing anything like that. I am receiving a text message, initiating a bluetooth serial connection and then do exitapplication so as far as I can see my app is no longer running but the screen stays on until I reboot or explicitly turn it off.
 
Upvote 0

JordiCP

Expert
Licensed User
Longtime User
If some code acquires a lock, I think it will remain even if the application is finished. So the question is "who"did it?
Perhaps the wake up is not in the service itself but in the starter service or the activity if it is running before
If this is not the case, I would try deactivating different parts in your service until you find which is the one.
Can you upload a piece of code with this behaviour?
 
Upvote 0
Top