Code example for SparseArray

Methods: get, put

0
    /** 
     * Shows a {@link Presentation} on the specified display. 
     */ 
    private void showPresentation(Display display, PresentationContents contents) {
        final int displayId = display.getDisplayId();
        if (mActivePresentations.get(displayId) != null) {
            return; 
        } 
 
        Log.d(TAG, "Showing presentation photo #" + contents.photo
                + " on display #" + displayId + ".");
 
        DemoPresentation presentation = new DemoPresentation(this, display, contents);
        presentation.show();
        presentation.setOnDismissListener(mOnDismissListener);
        mActivePresentations.put(displayId, presentation);
    } 
 
    /** 
     * Hides a {@link Presentation} on the specified display. 
     */