title: PackageManager throws NameNotFoundException for all apps even for my own app
body: <p>I'm loading all apps from android and then I display them in my launcher (icon + name). Code looks like following:</p>
  
  <pre><code>public class PhoneAppItem
  {
      String mPackageName = null;
      String mActivityName = null;
  
      String mName = null;
      ActivityInfo mActivityInfo = null;
  
      public PhoneAppItem(String packageName, String activityName)
      {
          mPackageName = packageName;
          mActivityName = activityName;
      }
  
      public void loadInfo()
      {
          PackageManager pm = MainApp.get().getPackageManager();
          try
          {
              // following line throws the exception!
              mActivityInfo = pm.getActivityInfo(new ComponentName(mPackageName, mActivityName), 0);
              // some other code...
          }
          catch (PackageManager.NameNotFoundException e)
          {
              L.e(e);
              mName = mPackageName;
          }
          catch (NullPointerException e)
          {
              L.e(e);
              mName = mPackageName;
          }
      }   
  }
  </code></pre>
  
  <p>Package names and activity names for all my <code>PhoneAppItem</code> items are retrieved like following (for android &lt; 5 which is relevant for the only yet known device having this issue):</p>
  
  <pre><code>List&lt;PhoneAppItem&gt; apps = new ArrayList&lt;&gt;();
  ActivityManager activityManager = (ActivityManager) MainApp.get().getSystemService(Context.ACTIVITY_SERVICE);
  List&lt;ActivityManager.RunningAppProcessInfo&gt; processInfos = activityManager.getRunningAppProcesses();
  for (ActivityManager.RunningAppProcessInfo processInfo : processInfos)
  {
      try
      {
          ApplicationInfo ai = pm.getApplicationInfo(processInfo.processName, 0);
          if (!excludedPackages.contains(ai.packageName))
              apps.add(new PhoneAppItem(ai.packageName, ai.className));
      }
      catch (PackageManager.NameNotFoundException e) {}
  }
  </code></pre>
  
  <p>I now have a user that get's following exception:</p>
  
  <pre><code>android.content.pm.PackageManager$NameNotFoundException: ComponentInfo{com.package.myapp/com.package.myapp.app.MainApp}
      at android.app.ApplicationPackageManager.getActivityInfo(ApplicationPackageManager.java:262)
      at com.package.myap.classes.PhoneAppItem.h(PhoneAppItem.java:70)
      ...
  </code></pre>
  
  <p><strong>Observations</strong></p>
  
  <ul>
  <li>the exception above is thrown for all apps, even for my <em>own</em> app</li>
  <li>until now, this behaviour is unique to one user using following hardware: Lenovo Yoga Tablet HD+ (b8080), Android 4.4.2</li>
  </ul>
  
  <p><strong>Question</strong></p>
  
  <p>Does anyone have an idea why this could happen?</p>