Java
private boolean isMyServiceRunning() {
ActivityManager manager = (ActivityManager) getSystemService(ACTIVITY_SERVICE);
for (RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) {
if ("com.dir.pack.DemoService".equals(service.service.getClassName())) {
return true;
}
}
return false;
}
Here in the if condition we need to give the service file name with the package. So on the checking area you can simply call this function in the if statement like
Java
if(isMyServiceRunning()) {
System.out.println("Service is running");
} else {
System.out.println("Service is not running");
}
Have a nice day
This is really nice post works well and easy to configure...thanks for all info.
Free Source Code
Free Source code For Academic
Academic Project Download
Academic Project Free Download
Freelancer In India
I found your blog while searching for the updates, I am happy to be here. Very useful content and also easily understandable providing.
ReplyDeletePhp projects with source code
Online examination system in php
Student management system in php
Php projects for students
Free source code for academic
Academic projects provider in nashik
Academic project free download
Hello There. I found your blog using msn. This is a really well written article. I will make sure to bookmark it and return to read more of your useful info. Thanks for the post. I will certainly comeback. mac neukölln berlin
ReplyDelete총판출장샵
ReplyDelete총판출장샵
고고출장샵
조조출장샵
조조출장샵
카오스출장샵
심심출장샵
총판출장샵
총판출장샵
총판출장샵