title: Displaying contact's photo by photo_ID
body: <p>I let the user select a contact in my app, and I display it on the home screen widget, but the photo is not displayed and I don't know what's wrong.</p>
  
  <p>This is how I get the reference to the photo:</p>
  
  <pre><code>...
  Cursor c = null;
  try {
      c = getContentResolver().query(uri, new String[] {
              ContactsContract.CommonDataKinds.Phone.NUMBER,
              ContactsContract.CommonDataKinds.Phone.TYPE,
              ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME,
              ContactsContract.CommonDataKinds.Phone.PHOTO_ID },
              null, null, null);
  
      if (c != null &amp;&amp; c.moveToFirst()) {
          String number = c.getString(0);
          int type = c.getInt(1);
          String name = c.getString(2);
          int photo = c.getInt(3);
          showSelectedNumber(type, number, name, photo);
      }
  }
  </code></pre>
  
  <p>This is how I display it:</p>
  
  <pre><code>public void showSelectedNumber(int type, String number, String name, int photo) {
      mAppWidgetPrefix.setText(name);
      pickedNumber.setText(number);
      pickedPhoto.setImageResource(photo);
  }
  </code></pre>
  
  <p>Why doesn't it work?</p>