PacketManager name not found error
<p>I am trying to display all running apps on my android in a list view, my code is showing all running apps but in some processes it is throwing exception, </p>

<p>cause: Package Manager not found with exception messege <code>android.process.acore and android.process.media.</code></p>

<p>I am using below code:</p>

<pre><code>while(i.hasNext())
        {
ActivityManager.RunningAppProcessInfo info = (ActivityManager.RunningAppProcessInfo)(i.next());

              try {
                CharSequence c = pm.getApplicationLabel(pm.getApplicationInfo(info.processName, PackageManager.GET_META_DATA));

                Process[j] =  c.toString();
                ListAdapter adapter = new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1, Process);

                ListView ProcessList = (ListView) findViewById(R.id.list); 
                ProcessList.setAdapter(adapter);  


                  }
              catch(Exception e)
              {
                  System.err.println("Caught Exception: "
                            + e.getMessage());

                //Name Not FOund Exception
              }
</code></pre>
