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 
Experience pair programming with AI  Get Codota for Java