title: Empty Cursor when querying contact uri
body: <p>My little test app picks one contact using the contact picker:</p>
  
  <pre><code>    final Intent contactPickerIntent = new Intent(Intent.ACTION_PICK,
              android.provider.ContactsContract.CommonDataKinds.Phone.CONTENT_URI);
      startActivityForResult(contactPickerIntent, PICK_CONTACT);
  </code></pre>
  
  <p>in the onActivityResult method, I parse the result and it's something like <code>content://com.android.contacts/data/7557</code>. I then query this uri to get its name and lookup key: </p>
  
  <pre><code>final String[] projection = new String[] {
      ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME,
      ContactsContract.CommonDataKinds.Phone.LOOKUP_KEY };
  final Cursor c = getContentResolver().query(contactUri, projection, null, null, null);
  if (c.moveToFirst()) {
      final String name = c.getString(c.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME));
      final String lookupKey = c.getString(c.getColumnIndex(ContactsContract.CommonDataKinds.Phone.LOOKUP_KEY));
      Log.d(TAG, "picked contact, name: " + name + ", lookup key: " + lookupKey);
  }
  </code></pre>
  
  <p>It works fine, but not for SOME contacts. Some contacts will result in an empty cursor.
  I checked out other questions. This one seems to have the same problem <a href="https://stackoverflow.com/questions/13823097/android-querying-contacts-sometimes-returns-empty-cursor">querying contacts - SOMETIMES returns empty cursor</a> (but no answers). I tried the approach of the solution proposed in this question, <a href="https://stackoverflow.com/questions/3370628/retrieve-contact-phone-number-from-uri-in-android">Retrieve Contact Phone Number From URI in Android</a>: </p>
  
  <pre><code>final String id = contactUri.getLastPathSegment();
  final String[] whereArgs = new String[] { id };
  final Cursor c2 = getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null,
      ContactsContract.CommonDataKinds.Phone._ID + " = ?", whereArgs, null);
  if (c2.moveToFirst()) {
      final String name = c.getString(c.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME));
      final String lookupKey = c.getString(c.getColumnIndex(ContactsContract.CommonDataKinds.Phone.LOOKUP_KEY));
  }
  </code></pre>
  
  <p>but unfortunately the problem stays: SOME contacts will result in an empty cursor. 
  What am I doing wrong? Thanks anybody for the help.</p>