|
79 | 79 | * Here's how to use the media router to create and show a presentation on the preferred |
80 | 80 | * presentation display using {@link android.media.MediaRouter.RouteInfo#getPresentationDisplay()}. |
81 | 81 | * </p> |
82 | | - * {@samplecode |
| 82 | + * <pre> |
83 | 83 | * MediaRouter mediaRouter = (MediaRouter) context.getSystemService(Context.MEDIA_ROUTER_SERVICE); |
84 | 84 | * MediaRouter.RouteInfo route = mediaRouter.getSelectedRoute(); |
85 | | - * if (route != null) ${ |
| 85 | + * if (route != null) { |
86 | 86 | * Display presentationDisplay = route.getPresentationDisplay(); |
87 | | - * if (presentationDisplay != null) ${ |
| 87 | + * if (presentationDisplay != null) { |
88 | 88 | * Presentation presentation = new MyPresentation(context, presentationDisplay); |
89 | 89 | * presentation.show(); |
90 | | - * $} |
91 | | - * $} |
92 | | - * } |
| 90 | + * } |
| 91 | + * }</pre> |
93 | 92 | * <p> |
94 | 93 | * The following sample code from <code>ApiDemos</code> demonstrates how to use the media |
95 | 94 | * router to automatically switch between showing content in the main activity and showing |
|
114 | 113 | * {@link DisplayManager#getDisplays(String)} and the |
115 | 114 | * {@link DisplayManager#DISPLAY_CATEGORY_PRESENTATION} category. |
116 | 115 | * </p> |
117 | | - * {@samplecode |
| 116 | + * <pre> |
118 | 117 | * DisplayManager displayManager = (DisplayManager) context.getSystemService(Context.DISPLAY_SERVICE); |
119 | 118 | * Display[] presentationDisplays = displayManager.getDisplays(DisplayManager.DISPLAY_CATEGORY_PRESENTATION); |
120 | | - * if (presentationDisplays.length > 0) ${ |
| 119 | + * if (presentationDisplays.length > 0) { |
121 | 120 | * // If there is more than one suitable presentation display, then we could consider |
122 | 121 | * // giving the user a choice. For this example, we simply choose the first display |
123 | 122 | * // which is the one the system recommends as the preferred presentation display. |
124 | 123 | * Display display = presentationDisplays[0]; |
125 | 124 | * Presentation presentation = new MyPresentation(context, presentationDisplay); |
126 | 125 | * presentation.show(); |
127 | | - * $} |
128 | | - * } |
| 126 | + * }</pre> |
129 | 127 | * <p> |
130 | 128 | * The following sample code from <code>ApiDemos</code> demonstrates how to use the display |
131 | 129 | * manager to enumerate displays and show content on multiple presentation displays |
|
0 commit comments