Retrieve the contact that is associated with a completed call
You can retrieve the
contact that is associated with a completed call from the call log on a
BlackBerry® device.
Code sample
String phoneNum = "519-555-0151";
PhoneCallLogID callLog = new PhoneCallLogID(phoneNum);
BlackBerryContact contact = callLog.getContact();
if (contact != null)
{
String[] name = contact.getStringArray(Contact.NAME, 0);
add(new RichTextField("The matching contact is " + name[Contact.NAME_GIVEN]
+ " " + name[Contact.NAME_FAMILY]));
}
else
{
add(new RichTextField("There is no matching contact"));
}
Next topic: Retrieve contacts by phone number
Previous topic: Retrieve the contact that is associated with an active call