Java tutorial
//package com.java2s; //License from project: Apache License import android.app.ActivityManager; import android.app.Service; import android.content.Context; public class Main { public static boolean isServiceRunning(Class<? extends Service> service, Context context) { ActivityManager manager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); for (ActivityManager.RunningServiceInfo runningServiceInfo : manager .getRunningServices(Integer.MAX_VALUE)) { if (service.getName().equals(runningServiceInfo.service.getClassName())) { return true; } } return false; } }