Android Question Background Service stopping after few minutes . Maybe this helps.

walmo

Active Member
Licensed User
Longtime User
Hi
Don't know if this is obvious.....
Maybe this will help someone else.
(Using the StartServiceAt and not the android.app.Service.START_STICKY)
Struggling for 2 days to get a background service to stay active.
At last i found the problem , DO NOT USE ANY DATA from the activity screen in your service.
I had one string that i pulled from the main screen , the service will run for 5 minutes after pressing power button to lock screen and then just stop.
Now it's running fine.
Hope it helps.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…