2

I'm playing with Android, and when I'm testing different Activities/Intent flags or launch mode, I can not get expected behavior(especially when different activity has different flags). And I have read Google Dev Guide very carefully, but still can not explain the result I get.

I'm wondering If there are some debug tools or some methods that I can check the back stack of different tasks in real time?

Looking forward to your expertise or comments.

Thank you.

posaidong
  • 663
  • 6
  • 11

2 Answers2

6

You can use adb shell dumpsys activity

Then look for the section that shows the task stacks. There's an entry there for each activity in the stack and you can see the Intent flags and lots of other goodies.

EDIT: Here's another suggestion:

You can also use this nice tool from Gonçalo Silva at Novoda. This is a simple tool that allows you to experiment with launch modes, intent flags, etc. and it visualizes the activity stack for you. The source code is freely available, so you can play with it and add your own stuff. You can download the APK directly from Google Play to see how it works.

David Wasser
  • 93,459
  • 16
  • 209
  • 274
0

You can use a more specific command to print only the current activity back stack:

adb shell dumpsys activity activities
makovkastar
  • 5,000
  • 2
  • 30
  • 50