Add feature: get boolean value for 'this process is running the foreground UI'
WindSekirun opened this issue · 1 comments
WindSekirun commented
Add feature: get boolean value for 'this process is running the foreground UI'
WindSekirun commented
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
}
}
}