QuickContactBadge in ListView
<p>I have a ListView which dynamically adds QuickContactBadge and a TextView to show contact names and their photo in QuickContactBadge. I am using the following code to show photo in QuickContactBadge...</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>Then i am calling this method by saying    </p>

<pre><code>quickContactBadge.setImageBitmap(loadContactPhoto(getContentResolver(), contactId));
</code></pre>

<p>I have following problem</p>

<p>1) The image is getting displayed, but it is huge. how to control size of quickcontactbadge.
2) Is this the best way to show image of a contact in quickContactBadge or if there is a preferred way, please let me know.</p>

<p>Thanks</p>
