Created
February 7, 2015 13:55
-
-
Save voltazor/c0c91ef7aa5a6fa8179d to your computer and use it in GitHub Desktop.
Check Android application backgroung/foreground/visible
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static final int IMPORTANCE_BACKGROUND = 400; | |
public static final int IMPORTANCE_FOREGROUND = 100; | |
public static final int IMPORTANCE_VISIBLE = 200; | |
ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); | |
List<ActivityManager.RunningAppProcessInfo> list2 = am.getRunningAppProcesses(); | |
for (ActivityManager.RunningAppProcessInfo ti : list2) { | |
Log.i("IMPORTANCE CODE", String.valueOf(ti.importance)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment