Code example for Map

Methods: clear

0
    return recipient;
////    return new Recipient(null, number, ContactPhotoFactory.getDefaultContactPhoto(context)); 
  } 
 
  public void clearCache() { 
    recipientCache.clear();
  } 
 
  private RecipientDetails getRecipientDetails(Context context, String number) {
    Uri uri       = Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI, Uri.encode(number));
    Cursor cursor = context.getContentResolver().query(uri, CALLER_ID_PROJECTION,
                                                       null, null, null); 
 
    try { 
      if (cursor != null && cursor.moveToFirst()) {
        Uri contactUri      = Contacts.getLookupUri(cursor.getLong(2), cursor.getString(1));
        Bitmap contactPhoto = getContactPhoto(context, Uri.withAppendedPath(Contacts.CONTENT_URI,
                                                                            cursor.getLong(2)+""));
 
        return new RecipientDetails(cursor.getString(0), contactUri, contactPhoto);
      }