return contactList;
}
public static ContactDetails getContactDetails(String contactID,int mode){
ContactDetails contactDetails = null;
AddressBook addressBook = Helpers.getAddressBook();
if (addressBook == null) {
System.out.println("getContactDetails - addressBook returns null");
return null;
}
for(int i=0;i<addressBook.GetContactCount();i++){
Contact contact = addressBook.GetContact(i);
if(contact==null)
continue;
if(contactID.equals(contact.getContact_id())){
contactDetails = new ContactDetails();
contactDetails.setEmail(contact.getEmail());
contactDetails.setLabel(contact.getGui_label());
contactDetails.setPublicKey(contact.getPublic_key());
contactDetails.setMemo(contact.getMemo());
contactDetails.setContact(contact);
List data = new ArrayList();
System.out.println("mode:"+mode+" contact.GetContactAcctCount():"+contact.GetContactAcctCount());
if(mode==1){
for(int j=0;j<contact.GetContactAcctCount();j++){
if(contact.GetContactAcct(j)==null)
continue;
data.add(new String[]{contact.GetContactAcct(j).getGui_label()});
}
contactDetails.setContactAccts(data);
}else{
for(int j=0;j<contact.GetContactNymCount();j++){
if(contact.GetContactNym(j)==null)
continue;
data.add(new String[]{contact.GetContactNym(j).getGui_label()});
}
contactDetails.setContactNyms(data);
}
break;
}
}
return contactDetails;