I'm trying to create an app ("ShowStack") to view the current App Back Stack (for development purposes). I know it can be done by using adb with the command "adb shell dumpsys activity activities". I tried using ActivityManager functions getAppTasks() and getRunningProcesses, etc. But these only return a list of 1 item, the current app/task "ShowStack", which I already knew thank you.
How can I view all tasks/activities?