title: Load contact photos in list view (with CursorAdapter) is very laggish
body: <p>Im building a contact application.
  In the main activity i have a listview, where i show the contacts.</p>
  
  <p>I'm using a CursorAdapter to handle tha cursor with the list</p>
  
  <p>It all works well without photos.</p>
  
  <p>However, when i try to use photos the scrolling becomes laggish.</p>
  
  <p>Thc calling to open the input stream is very slow, even if the inputStream is null and there's no image to load:</p>
  
  <pre><code>public static Bitmap loadContactPhoto(ContentResolver cr, long  id) 
  {
     Uri uri = ContentUris.withAppendedId(ContactsContract.Contacts.CONTENT_URI, id);
     InputStream input = ContactsContract.Contacts.openContactPhotoInputStream(cr, uri);
  
     if (input == null) 
     {
         return null;
     }
  
     return BitmapFactory.decodeStream(input);
  }
  </code></pre>
  
  <p>What can I do about it?</p>