@Override protected void onPause() { // Be sure to call the super class. super.onPause(); // Unregister from the display manager. mDisplayManager.unregisterDisplayListener(mDisplayListener); // Dismiss all of our presentations but remember their contents. Log.d(TAG, "Activity is being paused. Dismissing all active presentation."); for (int i = 0; i < mActivePresentations.size(); i++) { DemoPresentation presentation = mActivePresentations.valueAt(i); int displayId = mActivePresentations.keyAt(i); mSavedPresentationContents.put(displayId, presentation.mContents); presentation.dismiss(); } mActivePresentations.clear(); }
@Override protected void onPause() { // Be sure to call the super class. super.onPause(); // Unregister from the display manager. mDisplayManager.unregisterDisplayListener(mDisplayListener); // Dismiss all of our presentations but remember their contents. Log.d(TAG, "Activity is being paused. Dismissing all active presentation."); for (int i = 0; i < mActivePresentations.size(); i++) { DemoPresentation presentation = mActivePresentations.valueAt(i); int displayId = mActivePresentations.keyAt(i); mSavedPresentationContents.put(displayId, presentation.mContents); presentation.dismiss(); } mActivePresentations.clear(); }
/** * Hides a {@link Presentation} on the specified display. */ private void hidePresentation(Display display) { final int displayId = display.getDisplayId(); DemoPresentation presentation = mActivePresentations.get(displayId); if (presentation == null) { return; } Log.d(TAG, "Dismissing presentation on display #" + displayId + "."); presentation.dismiss(); mActivePresentations.delete(displayId); }
/** * Hides a {@link Presentation} on the specified display. */ private void hidePresentation(Display display) { final int displayId = display.getDisplayId(); DemoPresentation presentation = mActivePresentations.get(displayId); if (presentation == null) { return; } Log.d(TAG, "Dismissing presentation on display #" + displayId + "."); presentation.dismiss(); mActivePresentations.delete(displayId); }