Code example for SparseArray

Methods: put

0
    public Integer getId(Pair<ResourceType, String> resource) {
        Integer value = mDynamicIds.get(resource);
        if (value == null) {
            value = Integer.valueOf(++mDynamicSeed);
            mDynamicIds.put(resource, value);
            mRevDynamicIds.put(value, resource);
        } 
 
        return value;
    } 
 
    public Pair<ResourceType, String> resolveId(int id) {
        return mRevDynamicIds.get(id);
    } 
} 
Stop searching for code, let great code find you!  Add Codota to your java IDE