public void addContact(final String address,final String nickname) throws ImException {
  if (null == address) {
    throw new NullPointerException();
  }
  if (mManager.getState() == ContactListManager.BLOCKED_LIST_LOADED) {
    if (mManager.isBlocked(address)) {
      throw new ImException(ImErrorInfo.CANT_ADD_BLOCKED_CONTACT,"Contact has been blocked");
    }
  }
  Contact contact=getContact(address);
  if (contact == null) {
    contact=new Contact(new XmppAddress(address),nickname);
  }
 else   if (nickname != null)   contact.setName(nickname);
  try {
    mManager.addContactToListAsync(contact,ContactList.this,true);
  }
 catch (  ImException e) {
    e.printStackTrace();
  }
}

public void addContact ( final String address , final String nickname ) throws ImException { if ( null == address ) { throw new NullPointerException ( ) ; } if ( mManager . getState ( ) == ContactListManager . BLOCKED_LIST_LOADED ) { if ( mManager . isBlocked ( address ) ) { throw new ImException ( ImErrorInfo . CANT_ADD_BLOCKED_CONTACT , "Contact has been blocked" ) ; } } Contact contact = getContact ( address ) ; if ( contact == null ) { contact = new Contact ( new XmppAddress ( address ) , nickname ) ; } else if ( nickname != null ) contact . setName ( nickname ) ; try { mManager . addContactToListAsync ( contact , ContactList . this , true ) ; } catch ( ImException e ) { e . printStackTrace ( ) ; } }
add a contact to the list . the contact is specified by its address string .
