我正在为电视应用程序实现一个小部件,我想在其中显示流媒体,因此我必须在其中放置SurfaceView。由于widget有RemoteViews,我如何使用SurfaceView来设置SurfaceHolder的值?我已经在xml中定义了SurfaceView。我在互联网上搜索过但没有找到任何帮助。我想要 SurfaceView 的实例,以便我可以使用它。
最佳答案
As widget has RemoteViews, how can I use SurfaceView
这是不可能的。 SurfaceView
不可与应用小部件一起使用,如 the documentation 中所述。 .
Any alternative for SurfaceView
无法显示应用程序小部件中的视频。最好的情况是,您可以尝试编写自己的主屏幕实现来执行此操作。
关于android - 小部件中的 SurfaceView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24732762/