title: How to get context from ActivityManager.RunningTaskInfo?
body: <p>I want to get context from the below code.</p>
  
  <p>I have not able to find the how to get activity so please help me in same.</p>
  
  <p><strong>CODE :</strong></p>
  
  <pre><code>ActivityManager mActivityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
  List&lt;ActivityManager.RunningTaskInfo&gt; RunningTask = mActivityManager.getRunningTasks(1);
  ActivityManager.RunningTaskInfo ar = RunningTask.get(0);
  String activityOnTop=ar.topActivity.getClassName();
  </code></pre>
  
  <p>Thanks in Advance</p>