Android 检测正在运行的service

来源:互联网 发布:希捷同步软件 编辑:程序博客网 时间:2024/06/07 17:57
public static boolean isServiceRunning(Context context) {    ActivityManager manager = (ActivityManager) context.getSystemService(ACTIVITY_SERVICE);    for (ActivityManager.RunningServiceInfo service : manager.getRunningServices(200)) {        if ("com.han.xposed.random_device.service.Time_DeviceService".equals(service.service.getClassName())) {            return true;        }    }    return false;}
阅读全文
0 0
原创粉丝点击