判读某个服务是否存在
来源:互联网 发布:linux openoffice调用 编辑:程序博客网 时间:2024/06/04 18:51
package
org.load.androiddaemon;
import
java.util.List;
import
android.app.ActivityManager;
import
android.content.Context;
public
class
Util {
// 判断服务是否开启
public
static
boolean
isServiceAlive(Context context,
String serviceClassName) {
ActivityManager manager = (ActivityManager) context
.getSystemService(Context.ACTIVITY_SERVICE);
List<ActivityManager.RunningServiceInfo> running = manager
.getRunningServices(
30
);
for
(
int
i =
0
; i < running.size(); i++) {
if
(serviceClassName.equals(running.get(i).service.getClassName())) {
return
true
;
}
}
return
false
;
}
}
0 0
- 判读某个服务是否存在
- VBA-判读文件是否存在
- 验证某个邮箱是否存在
- 判断某个进程是否存在
- 判断某个路径是否存在
- 判断某个路径是否存在
- 检测某个元素是否存在
- 如何在Shell中通过脚本判断某个服务是否存在的解决方法
- 判读是否为数字
- iOS 判读是否登录
- ZOJ 2475 Benny's Compiler 有向图判读点是否存在环内
- mysql 判读两个字符串是否存在交集(类似1,2,3字符串)
- 判断Intent服务是否存在
- 校验服务是否还存在
- 判断数据库中是否存在某个表
- VBA------ 判断某个文件是否存在函数
- 判断Part是否存在某个分类属性
- 查询数据库中某个元素是否存在
- Jquery的pagination前端分页技术,带查询功能
- 贪心算法--Communication System
- 第15周项目2阅读程序(1)
- stretchblt为什么会造成图片失真
- hdu5137最短路
- 判读某个服务是否存在
- iOS开发总结
- 微信之门
- Pascal's Triangle
- BZOJ 2657 ZJOI 2012 旅游(journey) 树的直径
- Java读取txt文件和写入txt文件
- ubuntu android-studio创建右侧快捷启动方式
- 《JSP实用教程(第2版)/耿祥义》错误之ResultSet不能颠倒字段顺序获取字段值
- Get Started: Chat application