How to notifi when new activity is started?
<p>I am new to android. I am developing one application related to ActivityManager. In that I am getting a list of applications running in the system using the fallowing code.</p>

<pre><code>ActivityManger.getRunningTasks(Integer.MAX_VALUE)

List&lt;RunningTaskInfo&gt; a=am.getRunningTasks(Integer.MAX_VALUE);

PackageManager pack=this.getPackageManager(); 

    for(int i=0;i&lt;a.size();i++){

    String packageName = a.get(i).topActivity.getPackageName();
    String appName= (String) pack.getApplicationLabel(pack.getApplicationInfo(packageName,PackageManager.GET_META_DATA));
    Drawable d=pack.getApplicationIcon(packageName);

  Log.v("details"," "+packageName+" &amp;&amp; "+appName);    

    }
</code></pre>

<p>By using the above i am getting list of activities are running.ok fine</p>

<p>But my intenction is how to notify when new activity is stared.</p>

<p>Is there any observers in activity manager.</p>

<p>If any one has idea,please help me</p>

<p>Thanks in advance.</p>
