Error when using ActivityManager.RunningTaskInfo
<p>I am running android 2.1 and wants to get currently running apps, after running following code I am getting error: The application has stopped unexpectedly</p>

<pre><code>ActivityManager mgr = (ActivityManager)context.getSystemService(ACTIVITY_SERVICE);
List&lt;ActivityManager.RunningTaskInfo&gt; tasks = mgr.getRunningTasks(100);   //error
</code></pre>

<p>Pls help.</p>
