public static boolean hasPhoneNumber(ContentResolver resolver,long contactID){
  Cursor phoneCursor;
  String[] selectionArgs={String.valueOf(contactID)};
  Uri contentUri=CommonDataKinds.Phone.CONTENT_URI;
  phoneCursor=resolver.query(contentUri,DataTypeQuery.PROJECTION,DataTypeQuery.SELECTION,selectionArgs,DataTypeQuery.SORTORDER + " LIMIT 1");
  if (phoneCursor == null) {
    return false;
  }
  try {
    return phoneCursor.getCount() > 0;
  }
 catch (  Exception e) {
    ErrorTracker.track(e);
  }
 finally {
    if (!phoneCursor.isClosed()) {
      phoneCursor.close();
    }
  }
  return false;
}

public static boolean hasPhoneNumber ( ContentResolver resolver , long contactID ) { Cursor phoneCursor ; String [ ] selectionArgs = { String . valueOf ( contactID ) } ; Uri contentUri = CommonDataKinds . Phone . CONTENT_URI ; phoneCursor = resolver . query ( contentUri , DataTypeQuery . PROJECTION , DataTypeQuery . SELECTION , selectionArgs , DataTypeQuery . SORTORDER + " LIMIT 1" ) ; if ( phoneCursor == null ) { return false ; } try { return phoneCursor . getCount ( ) > 0 ; } catch ( Exception e ) { ErrorTracker . track ( e ) ; } finally { if ( ! phoneCursor . isClosed ( ) ) { phoneCursor . close ( ) ; } } return false ; }
returns whether the contact with the particular contactid has at least one phone number
