View Single Post
Old 09-15-2009, 08:14 AM   #7
sonia1986
Knows Where the Search Button Is
 
Join Date: Jun 2009
Model: 7110
PIN: N/A
Carrier: engg.
Posts: 19
Default

Quote:
Originally Posted by vivartpandey View Post
there is no need to create a another class
private MenuItem _logoffMenu = new MenuItem("Select Contact", 110, 10) {
public void run() {
String contanctName = getPimList();

}
};
public String getPimList() {
BlackBerryContact contact = null;
String contactnames = null;
try {
BlackBerryContactList list = (BlackBerryContactList) PIM.getInstance().openPIMList(PIM.CONTACT_LIST,PIM .READ_WRITE);
contact = (BlackBerryContact) list.choose(null,BlackBerryContactList.AddressType s.EMAIL,false);
System.out.println("contact"+contact);
} catch (Exception e) {
}
int numValues = 0;
try {
numValues = contact.countValues(BlackBerryContact.TEL);
contactnames = new String();
} catch (Exception e) {
}
for (int i = 0; i < numValues; i++) {
if (contact.getAttributes(BlackBerryContact.TEL, i) == BlackBerryContact.ATTR_WORK) {
contactnames = contact.getString(BlackBerryContact.TEL, i);
System.out.println("contactnames"+contactnames);
}
}
return contactnames;
}

and use this contactName for your purpose.
thanks...but still facing the same problem.As i checked the flow it doesn't go after this line...
BlackBerryContactList list = (BlackBerryContactList) PIM.getInstance().openPIMList(PIM.CONTACT_LIST,PIM .READ_WRITE);
Offline   Reply With Quote