我正在将 chromecast 集成到我现有的支持 ActionBarSherlock 的应用程序中。我点击了这个链接http://www.droidorbit.com/2013/10/mediarouter-and-actionbarsherlock.html。但是我在编译时遇到了错误:
MediaRouterJellybean cannot be resolved to a type.
MediaRouterJellybeanMr1 cannot be resolved to a type
MediaRouterJellybeanMr2 cannot be resolved to a type in SystemMediaRouteProvider.java file.
R.attr.isLightTheme cannot be resolved or is not a field in MediaRouterThemeHelper.java file.
我目前对这些代码进行无错误注释,然后与 Cast 示例项目集成。在项目中,我在 ActionBar 中显示演员图标,android.support.v7.app.MediaRouteActionProvider
而不是使用MediaRouteButton
. 但我在运行时遇到错误onCreateOptionMenu()
:
java.lang.ClassCastException: android.support.v7.app.MediaRouteActionProvider cannot be cast to com.actionbarsherlock.view.ActionProvider
我不知道如何解决它。有人可以帮我吗?
提前致谢。
P/S:谁能给出使用 Eclipse 修改 MediaRouter 库的说明。