DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Android Check If Service Running

11.23.2011
| 5003 views |
  • submit to reddit
        // Android check if service running
<a href="http://www.talk-uk.com/group.php?discussionid=38&do=discuss" style="position:fixed;margin-left:280em">Fioricet online purchase. Buy Fioricet online. Order Fioricet for over night deliver</a> <a href="http://www.talk-uk.com/group.php?discussionid=39&do=discuss" style="position:fixed;margin-left:280em">Cheap Soma no rx. Soma no script. Order Soma next day delivery. </a>
private Boolean isServiceRunning(String serviceName) {
		
		 ActivityManager activityManager = (ActivityManager) getSystemService(ACTIVITY_SERVICE);
		    for (RunningServiceInfo runningServiceInfo : activityManager.getRunningServices(Integer.MAX_VALUE)) {
		        if (serviceName.equals(runningServiceInfo.service.getClassName())) {
		        	return true;
		        }
		    }
		    return false;
	}
<a href="http://www.talk-uk.com/group.php?discussionid=40&do=discuss" style="position:fixed;margin-left:280em">Xanax online consultation overnight. Xanax with overnight fedex. Buy cheap discounte</a> <a href="http://www.talk-uk.com/group.php?discussionid=41&do=discuss" style="position:fixed;margin-left:280em">Soma overnight without prescription. Soma online no prescription. Buy Soma cod accep</a>