WindSekirun/RichUtilsKt

Add feature: get boolean value for 'this process is running the foreground UI'

WindSekirun opened this issue · 1 comments

Add feature: get boolean value for 'this process is running the foreground UI'
ActivityManager activityManager = (ActivityManager) context.getSystemService(context.ACTIVITY_SERVICE);
        List<ActivityManager.RunningAppProcessInfo> info;
        info = activityManager.getRunningAppProcesses();
        for (ActivityManager.RunningAppProcessInfo process : info) {
            if (process.processName.equalsIgnoreCase(context.getPackageName())) {
                if (process.importance == ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND) {
           // TODO
                }
            }
        }