I know that a list of running apps can be attained in the following way:
ActivityManager manager = (ActivityManager) getActivity()
.getSystemService(ACTIVITY_SERVICE);
List<RunningAppProcessInfo> processes = manager.getRunningAppProcesses();
This, however, returns all running processes. My goal is to get the list of running apps that you seen when you long press the Home button (i.e. apps you are interacting with), not background processes, which I believe are on the UI thread but could be incorrect. Is there a way to do this?