Finding the names of the running activities
<p><strong>Edited to change 'running to 'running or paused and in background'</strong></p>

<p>Is there a method which which I can log the names of the classes of the activities running or paused and in the background (i.e. not finished) in my application?</p>

<p>I find the shell command <strong>adb shell dumpsys meminfo com.mypackage.myapp</strong> to be most useful in managing the activity stack but it only gives me the number of activities running, not their names.</p>

<p>For example on startup it gives me this snippet:</p>

<pre><code>** MEMINFO in pid 215 [com.mypackage.myapp] **
                    native   dalvik    other    total
            size:     4336     3203      N/A     7539
       allocated:     4326     2527      N/A     6853
            free:        9      676      N/A      685
           (Pss):     1034     1974     1994     5002
  (shared dirty):     2160     4732     1564     8456
    (priv dirty):      864      684      912     2460

 Objects
           Views:       22        ViewRoots:        2
     AppContexts:        3       Activities:        2
          Assets:        2    AssetManagers:        2
   Local Binders:        7    Proxy Binders:       11
Death Recipients:        0
 OpenSSL Sockets:        0
</code></pre>

<p>Now I reckon I should only have one activity occupying memory, yet it tells me there are two. I'd quite like to know what the other one is.</p>
