Exemple #1
0
 private String getMultiString(Contact c, int field, int attr) {
   try {
     String result = "";
     String[] array = c.getStringArray(field, attr);
     for (int j = 0; j < array.length; j++) {
       if (array[j] != null) {
         result += array[j] + " ";
       }
     }
     return result;
   } catch (Exception e) {
   }
   return "";
 }
Exemple #2
0
  private void getName(PIMList list, Contact c) {
    if (list.isSupportedField(Contact.NAME)) {

      if (c.countValues(Contact.NAME) != 0) {
        String[] array = c.getStringArray(Contact.NAME, Contact.ATTR_NONE);
        if (list.isSupportedArrayElement(Contact.NAME, Contact.NAME_FAMILY)) {
          if (array[Contact.NAME_FAMILY] != null) {
            m_info[PIM_LAST_NAME] = array[Contact.NAME_FAMILY];
          }
        }
        if (list.isSupportedArrayElement(Contact.NAME, Contact.NAME_GIVEN)) {
          if (array[Contact.NAME_GIVEN] != null) {
            m_info[PIM_FIRST_NAME] = array[Contact.NAME_GIVEN];
          }
        }
      }
    }
    if (list.isSupportedField(Contact.FORMATTED_NAME)) {
      m_info[PIM_FULL_NAME] = getString(c, Contact.FORMATTED_NAME, Contact.ATTR_NONE);
    } else {
      m_info[PIM_FULL_NAME] = m_info[PIM_LAST_NAME] + " " + m_info[PIM_FIRST_NAME];
    }
  }