首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何访问RemoteView视图?

如何访问RemoteView视图?
EN

Stack Overflow用户
提问于 2014-12-19 14:11:57
回答 1查看 1.8K关注 0票数 1

其想法是获取小部件或通知的SurfaceHolder of SurfaceView。我有wid.xml:

代码语言:javascript
复制
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
   android:id="@+id/root" >

    <Button
        android:id="@+id/btn"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Button" />

    <SurfaceView
        android:id="@+id/sfv1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

</LinearLayout>

在服务中,我可以得到一个RemoveView

代码语言:javascript
复制
RemoteViews layout = new RemoteViews(getPackageName(), R.layout.wid);//sfv1
        int ll = layout.getLayoutId();

如何才能访问sfv1 (SurfaceView)

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-12-19 14:19:29

下面列出了RemoteViews支持的布局类和小部件的列表,其中没有看到SurfaceView

http://developer.android.com/guide/topics/appwidgets/index.html#CreatingLayout

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/27567812

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档