title: No package identifier when getting value for resource
body: <p>I am trying to get list of all apps on device ThirdParty and System, I run this operation in <code>AsyncTask</code>, When the app open the task run and i see a long operation when getting this list during this operation i see that warnings printed in the <code>Logcat</code> and i think it's the reason behind the long operation:</p>
  
  <pre><code>11-26 09:51:23.720 1739-1846/com.example.AppList W/ResourceType: No package identifier when getting value for resource number 0x00000000
  11-26 09:51:23.720 1739-1846/com.example.AppList W/PackageManager: Failure retrieving resources for com.google.android.onetimeinitializer: Resource ID #0x0
  11-26 09:51:23.870 1739-1846/com.example.AppList W/ResourceType: No package identifier when getting value for resource number 0x00000000
  11-26 09:51:23.870 1739-1846/com.example.AppList W/PackageManager: Failure retrieving resources for com.qualcomm.shutdownlistner: Resource ID #0x0
  11-26 09:51:23.994 1739-1846/com.example.AppList W/ResourceType: No package identifier when getting value for resource number 0x00000000
  11-26 09:51:23.994 1739-1846/com.example.AppList W/PackageManager: Failure retrieving resources for com.android.wallpapercropper: Resource ID #0x0
  11-26 09:51:24.744 1739-1846/com.example.AppList W/ResourceType: No package identifier when getting value for resource number 0x00000000
  11-26 09:51:24.744 1739-1846/com.example.AppList W/PackageManager: Failure retrieving resources for com.android.documentsui: Resource ID #0x0
  11-26 09:51:24.873 1739-1846/com.example.AppList W/ResourceType: No package identifier when getting value for resource number 0x00000000
  11-26 09:51:24.874 1739-1846/com.example.AppList W/PackageManager: Failure retrieving resources for com.android.externalstorage: Resource ID #0x0
                                        ....
                                        ....
  /** 
   * I got all installed and system apps on the device
   * listed as the above in the logcat as Warning.
   */
                                        ....
                                        .... to the end.
  </code></pre>
  
  <p>This is the <code>doInBackground</code> code:</p>
  
  <pre><code>@Override
      protected final List&lt;App&gt; doInBackground(List&lt;App&gt;... params) {
  
          PackageManager pm = getActivity().getPackageManager();
          List&lt;ApplicationInfo&gt; appsList = pm.getInstalledApplications(0);
          List&lt;PackageInfo&gt; packList = pm.getInstalledPackages(0);
          List&lt;App&gt; userApps = new ArrayList&lt;&gt;();
          int totalApp = appsList.size();
  
          for (int i = 0; i &lt; totalApp; i++) {
              ApplicationInfo info = appsList.get(i);
              final App app = new App();
  
              app.setIcon(info.loadIcon(getActivity().getPackageManager()));
              app.setName(info.loadLabel(getActivity().getPackageManager()).toString());
              app.setPackageName(info.packageName);
  
              if ((info.flags &amp; ApplicationInfo.FLAG_SYSTEM) == 0) {
                  userApps.add(app);
              }
          }
          return userApps;
      }
  </code></pre>
  
  <p>So how to fix this, or just How to fix the long operation?</p>
  
  <hr>
  
  <p><strong>EDIT</strong></p>
  
  <p>I tried to remove app icon functionality from the list and it's load faster than when the image is attached, so the problem in the image</p>
  
  <p>@David Corsalini told me this in <a href="https://stackoverflow.com/posts/comments/55639555?noredirect=1">comments</a>:</p>
  
  <blockquote>
    <p>Load the bitmap in a background thread, call this background thread from the <code>holder.bind()</code> method. I don't have the code for this one.</p>
  </blockquote>
  
  <p>I am using a <code>ListView</code> with <code>ViewHolder</code> but don't know about <code>holder.bind()</code>, so How to achieve this please?!</p>