title: How to display list of application names from package names
body: <p>I am developing an application which show all current applications. I am getting the apps package names, thats good but not specific applications name How should I do it, I am using following code:</p>
  
  <pre><code>Context context = this.getApplicationContext();
  ActivityManager mgr = (ActivityManager)context.getSystemService(ACTIVITY_SERVICE);
  
  List&lt;RunningTaskInfo&gt; tasks = mgr.getRunningTasks(30);
  
  List&lt;ActivityManager.RunningAppProcessInfo&gt; tasksP = mgr.getRunningAppProcesses();
  
  int numOfTasks = tasks.size();
  
  for(int i = 0; i &lt; numOfTasks; i++){
      ActivityManager.RunningAppProcessInfo task = tasksP.get(i);
  
      PackageInfo myPInfo = null;
      try {
          myPInfo = getPackageManager().getPackageInfo(task.processName, 0);
      } catch (NameNotFoundException e) {
          e.printStackTrace();
      }   
      Toast.makeText(location.this,
              task.processName,
              Toast.LENGTH_LONG).show();
  }
  </code></pre>
  
  <p>Also please tell me how to display these apps name in check boxes, so that I can kill my desired app.</p>