小部件中的SurfaceView [英] SurfaceView in widget
问题描述
我正在为电视应用程序实现一个小部件,要在其中显示流,因此必须在其中放置 SurfaceView .由于小部件具有RemoteViews,如何使用SurfaceView设置 SurfaceHolder 的值?我已经在xml中定义了SurfaceView.我在互联网上进行搜索,但没有找到任何帮助.我想要SurfaceView实例,以便可以使用它.
I am implementing a widget for TV application in which I want to show streaming so I have to place SurfaceView in it. As widget has RemoteViews, how can I use SurfaceView to set value of SurfaceHolder? I have defined SurfaceView in xml. I have searched on internet but didn't find any help. I want instance of SurfaceView so that I can play with it.
推荐答案
由于小部件具有RemoteViews,如何使用SurfaceView
As widget has RemoteViews, how can I use SurfaceView
那是不可能的. SurfaceView
不适用于应用程序小部件,如文档.
That is not possible. SurfaceView
is not available for use with app widgets, as is covered in the documentation.
SurfaceView的任何替代方法
Any alternative for SurfaceView
无法显示来自应用小部件的视频.充其量,您可以尝试编写自己的主屏幕实现来实现此目的.
It is not possible to show a video from an app widget. At best, you can try to write your own home screen implementation that does this.
这篇关于小部件中的SurfaceView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!