Recupero del contatto associato a una chiamata attiva
Esempio di codice
public void callIncoming(int callID) // in a phone listener
{
StringBuffer strBuffer = new StringBuffer();
PhoneCall call = Phone.getCall(callID);
BlackBerryContact contact = call.getContact();
if(contact != null)
{
if(contact.countValues(BlackBerryContact.ADDR) > 0)
{
String[] strArray = contact.getStringArray(BlackBerryContact.ADDR, 0);
String city = strArray[BlackBerryContact.ADDR_LOCALITY];
if(city != null && city.length() > 0)
{
strBuffer.append(city);
}
String country = strArray[BlackBerryContact.ADDR_COUNTRY];
if(country != null && country.length() > 0)
{
if(city != null && city.length() > 0)
{
strBuffer.append(", ");
}
strBuffer.append(country);
}
}
}
// use the contact info, for example,
// display it on the incoming phone screen
}
Attività correlate
Argomento successivo: Recupero del contatto associato a una chiamata completata
Argomento precedente: Rimozione di un elenco contatti
Le informazioni sono state utili? Inviateci i vostri commenti.