Code example for SparseArray

Methods: getput

0
     * Plays an earcon given its id. 
     * 
     * @param earconId The id of the earcon to be played. 
     */ 
    private void playEarcon(int earconId) {
        String earconName = mEarconNames.get(earconId);
        if (earconName == null) {
            // We do not know the sound id, hence we need to load the sound. 
            Integer resourceId = sSoundsResourceIds.get(earconId);
            if (resourceId != null) {
                earconName = "[" + earconId + "]";
                mTts.addEarcon(earconName, getPackageName(), resourceId);
                mEarconNames.put(earconId, earconName);
            } 
        } 
 
        mTts.playEarcon(earconName, QUEUING_MODE_INTERRUPT, null);
    } 
} 
Experience pair programming with AI  Get Codota for Java