Code example for Future

Methods: cancel

0
            return; 
        } 
 
        mItemRequests.remove(id);
        if (request.loadItemTask != null) {
            request.loadItemTask.cancel(true);
        } 
    } 
 
    private boolean itemViewReused(ItemRequest<Params, Result> request) {
        // If itemView is null, this means this is a preload request 
        // with no target view to display. No view to be possibly recycled 
        // in this case. 
        if (request.itemView == null) {
            return false; 
        } 
 
        // If the request's soft reference to the view is now null, this means 
        // the view has been disposed from memory. Just bail. 
        final View itemView = request.itemView.get();
        if (itemView == null) {