Intent Service -The IntentService class provides a straightforward structure for running an operation on a single background thread. IntentService runs outside the application in a background process, so the process will run even if your application is closed.10 Oca 2018
Read moreHow do you keep a Countdowntimer running even if the app is closed?
To keep the timer running while the app is closed, you need to use a service . Listen to the broadcast of the service in the activity. See this SO answer to learn whether registering the receiver in onCreate, onStart, or onResume is right for you.
Read more