【Android】【应用信息】获取服务列表

        ActivityManager activityManager = ServiceUtil.getActivityManager(ctx);
        //获取服务列表
        List serviceInfos = activityManager.getRunningServices(Integer.MAX_VALUE);
        for (ActivityManager.RunningServiceInfo info : serviceInfos) {
            String name = info.service.getClassName();
            boolean running = info.foreground;
            CodeUtil.info(name, running);
        }

你可能感兴趣的:(android)