Code example for ExecutorService

Methods: submit

0
      } 
    }; 
 
    ListenableFutureTask<RecipientDetails> future = new ListenableFutureTask<RecipientDetails>(task, null);
 
    asyncRecipientResolver.submit(future);
 
    Recipient recipient = new Recipient(number, ContactPhotoFactory.getDefaultContactPhoto(context), future);
    recipientCache.put(number, recipient);
 
    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,