2

I've been trying to teach myself Android, and have just learned that I've been creating multiple instances of the same Activity in my code. Conceptually I know it's there, but is there any tool (like DDMS, for example) that I can use to see that I've created multiple instances?

This would also help me find out if my experiments with Intent flags are working or not.

Bill the Lizard
  • 398,270
  • 210
  • 566
  • 880
Debojit
  • 568
  • 1
  • 10
  • 24

1 Answers1

4

You can visualize the current activity stack with the following command:

adb shell dumpsys activity

It will show you something like this:

 Running activities (most recent first):
    TaskRecord{40538e50 #164 A com.xxx}
      Run #3: HistoryRecord{xxxx com.xxx/.activities/xxx}
      Run #2: HistoryRecord{xxx com.xxx/.activities/xxx}
      Run #1: HistoryRecord{xxx com.xxx/.activities/xxx}
    TaskRecord{40a89008 #48 I com.android.htcdialer/.Dialer}
      Run #0: HistoryRecord{409d91d0 com.android.htcdialer/.Dialer}

Some resources:

  • Android Debug Bridge (ADB) on Android developer.

  • Android Tools by Romain Guy. (The entire talk isn't about ADB and what you can do with it, but it's worth taking some time watching since he introduces and demonstrates many debugging tools).

Amokrane Chentir
  • 29,907
  • 37
  • 114
  • 158
  • Thanks, this helps a lot. Could you perhaps point me to some resource where I can study this output to get a better understanding of it? – Debojit May 16 '12 at 12:33