Code example for ConcurrentHashMap

Methods: put, remove, size

0
        String url = view.getUrl();
        boolean loaded = loadPhotoFromCache(view, url);
        if (loaded) {
            mPendingMap.remove(view);
        } else { 
            mPendingMap.put(view, url);
            requestLoading(); 
        } 
 
        if (mPendingMap.size() == 0 && !mMainHandler.hasMessages(MESSAGE_REQUEST_LOAD)) {
            mIdle = true;
        } 
    } 
 
    private Bitmap getBitmapFromCache(String url) {
        BitmapHolder ref = mCacheMap.get(url);
        if (ref != null) {
            return ref.get();
        } else { 
            return null; 
        }