Code example for SparseArray

Methods: put

0
    } 
     
    public E put(String name, int uid, E value) {
        SparseArray<E> uids = mMap.get(name);
        if (uids == null) {
            uids = new SparseArray<E>(2);
            mMap.put(name, uids);
        } 
        uids.put(uid, value);
        return value;
    } 
     
    public void remove(String name, int uid) {
        SparseArray<E> uids = mMap.get(name);
        if (uids != null) {
            uids.remove(uid);
            if (uids.size() == 0) {
                mMap.remove(name);
            } 
        } 
Stop searching for code, let great code find you!  Add Codota to your java IDE