title: Android HAS_PHONE_NUMBER
body: <p>I am trying to write a method that determines if a contact has at least one phone number, at the moment I have this:</p>
  
  <pre><code>public boolean hasPhone() {
   Cursor phones = this.map.getContentResolver().query(
    ContactsContract.Contacts.CONTENT_URI,
    null,
    ContactsContract.Contacts._ID + "=" + this.contactId,
    null,
    null
   );
   boolean has = false;
   if(phones.moveToFirst()) {
    do {        
      if(Integer.parseInt(phones.getString(phones.getColumnIndex(ContactsContract.Contacts.HAS_PHONE_NUMBER))) &gt; 0) {
        has = true;
        break;
      }
    } while(phones.moveToNext());
   }
   return has;
  }
  </code></pre>
  
  <p>the method always returns false, even though I know the contact in question has a phone number.  Also I know the contactId is correct as I also use it to get the postal address, etc.</p>
  
  <p>Any help would be greatly appreciated, as I am about to tear my hair out :p</p>
  
  <p>Thanks.</p>