Fix CustomMRControllerDialog

This commit is contained in:
Martin Fietz 2017-09-23 10:22:10 +02:00
parent d4eab1581b
commit 7c6a27387e
1 changed files with 3 additions and 2 deletions

View File

@ -354,14 +354,15 @@ public class CustomMRControllerDialog extends MediaRouteControllerDialog {
boolean showTitle = false;
boolean showSubtitle = false;
if (route.getPresentationDisplayId() != MediaRouter.RouteInfo.PRESENTATION_DISPLAY_ID_NONE) {
if (route.getPresentationDisplay() != null &&
route.getPresentationDisplay().getDisplayId() != MediaRouter.RouteInfo.PRESENTATION_DISPLAY_ID_NONE) {
// The user is currently casting screen.
titleView.setText(android.support.v7.mediarouter.R.string.mr_controller_casting_screen);
showTitle = true;
} else if (state == null || state.getState() == PlaybackStateCompat.STATE_NONE) {
// Show "No media selected" as we don't yet know the playback state.
// (Only exception is bluetooth where we don't show anything.)
if (!route.isDeviceTypeBluetooth()) {
if (!route.isBluetooth()) {
titleView.setText(android.support.v7.mediarouter.R.string.mr_controller_no_media_selected);
showTitle = true;
}