android.support.v7.app.MediaRouteButton does not display

本小妞迷上赌 提交于 2019-12-05 15:47:02

AFter fiddling around with this thing, I was able to get the media Router button to show up. I am not entirely sure what I did but I did verify the appid and tried to use my whitelisted app id. I reinstalled the support library. THANK YOU ALL FOR WHO HELPED ON THIS!

I am not 100% sure how this happened but I hope that this helps someone figure out or at least get past this. ActionBar Activity and non action bar activities show the media router button now!!! :)

Implementing onRouteChanged() callback instead of onRouteAdded() should fix the issue.

Example code:
    // for MediaRouterButtonActivity
        @Override
        public void onRouteChanged(MediaRouter router, RouteInfo route) {
          if (++mRouteCount == 1) {
                // Show the button when a device is discovered.
                mMediaRouteButton.setVisibility(View.VISIBLE);
          }
    }
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!