Skip to content

Commit

Permalink
Merge branch 'hotfix/3.8.1' into release/3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
maxme committed Mar 19, 2015
2 parents 8373246 + 88e501b commit 7d96a03
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package org.wordpress.android.util;

import android.app.ActivityManager;
import android.content.Context;

public class ServiceUtils {
public static boolean isServiceRunning(Context context, Class<?> serviceClass) {
ActivityManager manager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
for (ActivityManager.RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) {
if (serviceClass.getName().equals(service.service.getClassName())) {
return true;
}
}
return false;
}
}

0 comments on commit 7d96a03

Please sign in to comment.