Code example for SparseIntArray

Methods: indexOfKey, put

        if (soundId <= 0) {
            LogUtils.log(this, Log.ERROR, "Failed to assign sound for %d", id);
            return false; 
        if (mSoundPoolMap.indexOfKey(id) >= 0) {
        mSoundPoolMap.put(id, soundId);
        mStreamTypeMap.put(id, streamType);
        return true; 
     * Generates a MIDI file from the specified {@code notes} array and loads it 
     * into the specified {@code soundPool}. 
     * @param soundPool The sound pool to load the MIDI file into. 
     * @param notes An array specifying a MIDI track. 
     * @return The sound identifier for the loaded MIDI notes, or {@code -1} on