2 Answers. Show activity on this post. Depends on the code, you can run the background service forever or close it as soon as the app has been exited. Apart from that, OS itself can close the background service if no action is performed by it for several minutes.