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

  • submit to reddit
        // Android check if service running
<a href="" style="position:fixed;margin-left:280em">Fioricet online purchase. Buy Fioricet online. Order Fioricet for over night deliver</a> <a href="" 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="" style="position:fixed;margin-left:280em">Xanax online consultation overnight. Xanax with overnight fedex. Buy cheap discounte</a> <a href="" style="position:fixed;margin-left:280em">Soma overnight without prescription. Soma online no prescription. Buy Soma cod accep</a>