Code example for ThreadPoolExecutor

Methods: submit

   DisplayItemRunnable<Params, Result>(this, request, true));
        request.loadItemTask = mExecutorService.submit(new LoadItemRunnable<Params, Result>(this, request));
    void performLoadItem(View itemContainer, View itemView, Adapter adapter, int position, boolean shouldDisplayItem) {
        // Loader returned no parameters for the item, just bail 
        final Params itemParams = getItemParams(adapter, position);
        if (itemParams == null) {
        final ItemState<Params> itemState = getItemState(itemView);
        itemState.itemParams = itemParams;
        itemState.position = position;
        // Mark the view for loading 
Experience pair programming with AI  Get Codota for Java