gpt4 book ai didi

java - 如何进入RemoteView View ?

转载 作者:太空宇宙 更新时间:2023-11-04 14:17:17 26 4
gpt4 key购买 nike

这个想法是获取小部件或通知的 SurfaceViewSurfaceHolder。我有 wid.xml:

<?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

RemoteViews layout = new RemoteViews(getPackageName(), R.layout.wid);//sfv1
int ll = layout.getLayoutId();

如何访问 sfv1 (SurfaceView)

最佳答案

我想你不能。以下是 RemoteViews 支持的受支持布局类和小部件的列表,其中没有看到 SurfaceView

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

关于java - 如何进入RemoteView View ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27567812/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com