Created
January 23, 2019 18:48
-
-
Save shishirthedev/019ba0b5fd2f2f373bc2eece4ae525bd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private boolean isMyServiceRunning(Class<?> serviceClass) { | |
| ActivityManager manager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE); | |
| for (ActivityManager.RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) { | |
| if (serviceClass.getName().equals(service.service.getClassName())) { | |
| return true; | |
| } | |
| } | |
| return false; | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment