title: Get name of contact by nickname in Android
body: <p>I have some problem with Contact Provider. I have a nickname, which stored in string variable <em>text</em>. I want to get name and surname of user, which have some nickname. But it's something wrong with my code:</p>
  
  <pre><code>String _string = "no name";
  Cursor cursor = getContentResolver().query(
      ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null,
      ContactsContract.CommonDataKinds.Nickname.NAME + " = " + text, new String[]{ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME}, null);
  int nameIndex = cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME);
  if (cursor.moveToFirst()) {
      _string = cursor.getString(nameIndex);
  }
  </code></pre>
  
  <p>I have error "bind or column index out of range".</p>