Skip to content

Commit c1d0640

Browse files
committed
encode utf8无bom
1 parent c94ac52 commit c1d0640

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

unclassified.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
# 未归类
2-
### 获取服务是否开启
1+
# 未归类
2+
### 获取服务是否开启
33
```
44
/**
5-
* 获取服务是否开启
5+
* 获取服务是否开启
66
*/
77
public static boolean isRunningService(String className, Context context) {
8-
//进程的管理者,活动的管理者
8+
//进程的管理者,活动的管理者
99
ActivityManager activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
10-
//获取正在运行的服务
11-
List<RunningServiceInfo> runningServices = activityManager.getRunningServices(1000);//maxNum 返回正在运行的服务的上限个数,最多返回多少个服务
12-
//遍历集合
10+
//获取正在运行的服务
11+
List<RunningServiceInfo> runningServices = activityManager.getRunningServices(1000);//maxNum 返回正在运行的服务的上限个数,最多返回多少个服务
12+
//遍历集合
1313
for (RunningServiceInfo runningServiceInfo : runningServices) {
14-
//获取控件的标示
14+
//获取控件的标示
1515
ComponentName service = runningServiceInfo.service;
16-
//获取正在运行的服务的全类名
16+
//获取正在运行的服务的全类名
1717
String className2 = service.getClassName();
18-
//将获取到的正在运行的服务的全类名和传递过来的服务的全类名比较,一直表示服务正在运行 返回true,不一致表示服务没有运行 返回false
18+
//将获取到的正在运行的服务的全类名和传递过来的服务的全类名比较,一直表示服务正在运行 返回true,不一致表示服务没有运行 返回false
1919
if (className.equals(className2)) {
2020
return true;
2121
}

0 commit comments

Comments
 (0)