其想法是获取小部件或通知的SurfaceHolder of SurfaceView。我有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)
发布于 2014-12-19 14:19:29
下面列出了RemoteViews支持的布局类和小部件的列表,其中没有看到SurfaceView。
http://developer.android.com/guide/topics/appwidgets/index.html#CreatingLayout
https://stackoverflow.com/questions/27567812
复制相似问题