title: Android Contacts - Get Phone number
body: <p>I'm trying to get all phone numbers of a contact in Android. My code looks like this:</p>
  
  <pre><code>ContentResolver cr = context.getContentResolver();
  String[] projection = new String[] { ContactsContract.CommonDataKinds.Phone.NUMBER };
  String selection = ContactsContract.Data.CONTACT_ID + "=" + contactId;
  Cursor nameCur = cr.query(ContactsContract.Data.CONTENT_URI, projection, selection, null, null);
  while (nameCur.moveToNext()) {
      String contact = nameCur.getString(nameCur.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));
  }
  </code></pre>
  
  <p>In principle, it works but the variable "contact" sometimes has values like "null", "1", "4" or "<em>phonenumber</em>@whatsapp". How can I really only get the phone numbers without these stupid WhatsApp Id strings?</p>