Code example for WeakHashMap

Methods: put

0
        int len = path.size();
        int id;
        if (len == 1) {
            try { 
                id = Integer.parseInt(path.get(0));
            } catch (NumberFormatException e) {
                throw new FileNotFoundException("Single path segment is not a resource ID: " + uri);
            } 
        } else if (len == 2) {
            id = r.getIdentifier(path.get(1), path.get(0), authority);
        } else { 
            throw new FileNotFoundException("More than two path segments: " + uri);
        } 
        if (id == 0) {
            throw new FileNotFoundException("No resource found for: " + uri);
        } 
        return r.getDrawable(id);
    } 
 
    private Drawable checkIconCache(String resourceUri) {
        Drawable.ConstantState cached = mOutsideDrawablesCache.get(resourceUri);