How to programmatically determine the currently active App in Android
Is there a way to find the app whose activity is curre开发者_如何学Gontly active in android? Does android send a broadcast when a new app/activity is active?
Call ActivityManager.getRunningAppProcesses(), then iterate through the ActivityManager.RunningAppProcessInfo objects and look for the one(s) with IMPORTANCE_FOREGROUND.
I'm not sure if there are situations (tablet? Laptop dock?) when you can have multiple foreground activities.
加载中,请稍侯......
精彩评论