How to run CountDownTimer in a Service in Android?
The easiest way is probably to create a broadcast receiver in your activity and have the service send broadcasts to the receiver. Here’s a full listing for a service class with a simplified CountDownTimer. package com.example.cdt; import android.app.Service; import android.content.Intent; import android.os.CountDownTimer; import android.os.IBinder; import android.util.Log; public class BroadcastService extends Service { private final static … Read more