Prevent the service from being closed

Asked

Viewed 969 times

1

Hello, I have an android app that tracks gps signal, works normal but every time it gets in the background it closes alone. I already researched on the subject and saw that the android controls the closure of applications in the background. Is there any function to prevent this and keep it always open?

  • Hello. From a look at this post, I think it might help you. http://answall.com/questions/10589/async-task-e-ou-aplication

1 answer

2


Use the class Service for Android, it’s perfect for apps that run in the background performing some task from time to time. You can use the service class in conjunction with the class Alarmmanager or Timertask. Your service running in the background will only be finished by the Operating System in extreme cases of need to release resources, and even if your service stops running, when you can the Android OS restarts its Service.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.