Hi,

I'm trying to get the foreground task using below code.

Code:
ActivityManager activityManager = (ActivityManager) getSystemService(UpdateService.ACTIVITY_SERVICE);
List<ActivityManager.RunningTaskInfo> appProcesses = activityManager.getRunningTasks(1);

Log.i("MyApp", "Foreground Package: " + appProcesses.get(0).topActivity.getPackageName());
It looks like its not working on Atrix 2.3.4. I dont have Atrix to try on

Any ideas?