public class Receiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
ActivityManager manager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
for (RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) {
if (YourService.class.getName().equals(service.service.getClassName())) {
//your service is running
}
}
//your service is not running
}
}