title: Android - Unable to fetch contact photo?
body: <p>i am trying to fetch a contact image using contact id.</p>
  
  <p>Here is my code :-</p>
  
  <pre><code>public Bitmap getDisplayPhoto(Long id)
  {
      Uri uri = ContentUris.withAppendedId(Contacts.CONTENT_URI,id);
      InputStream input = Contacts.openContactPhotoInputStream(this.getContentResolver(), uri);
      if (input == null)
      {
         return null;
      }
      return BitmapFactory.decodeStream(input);
  }
  </code></pre>
  
  <p>This code is returning null for all of my contacts including those which has an image.</p>
  
  <p>What am i doing wrong here?</p>
  
  <p>Please Help!!</p>
  
  <p>Thanks.</p>