I want to print all the tasks that my Android app has initiated with the names of the activities within them on LogCat. Is there any API in the SDK that can provide me this information?
p.s. I can't and don't want to use the adb shell commands as I want to print the logs in LogCat.
Note: I've searched quite a bit and all I've found are the adb shell commands which I can't use. Please keep that in mind while answering.
UPDATE:
Here's an example of what I want with 2 scenarios:
- App starts with activity A, I finish it and start activity B. Then I
press a button on activity B that starts activity C. Now my default
task would like
C -> Bi.e. when I press back, I'll see activity B and on pressing back app would finish and the launcher will be displayed. - I open activity A, B & C consecutively then I launch an
activity X with intent flags
Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASKand then open activities Y & Z. The current task will now look likeZ -> Y -> X.
So, I want to print these in logcat:
C -> Bin case 1Z -> Y -> Xin case 2


