Code example for SparseArray

import java.util.Map; 
public class DynamicIdMap { 
    private final Map<Pair<ResourceType, String>, Integer> mDynamicIds = new HashMap<Pair<ResourceType, String>, Integer>();
    private final SparseArray<Pair<ResourceType, String>> mRevDynamicIds = new SparseArray<Pair<ResourceType, String>>();
    private int mDynamicSeed;
    public DynamicIdMap(int seed) {
        mDynamicSeed = seed;
    public void reset(int seed) {
        mDynamicSeed = seed;
     * Returns a dynamic integer for the given resource type/name, creating it if it doesn't 
Stop searching for code, let great code find you!  Add Codota to your java IDE