我想从窗口小部件中显示的ListView中的服务添加项目。但是我怎样才能在服务中获得我的ListView?我的窗口小部件的布局是这样的:从窗口小部件布局中获取ListView
<ListView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/listView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
</ListView>
有了这个代码,我可以从我的插件的RemoteViews:
AppWidgetManager mgr = AppWidgetManager.getInstance(ctx);
RemoteViews rv = new RemoteViews(ctx.getPackageName(), R.layout.widget_layout);
但现在我怎样才能让我的ListView从RemoteViews?
[这里](https://github.com/laaptu/appwidget-listview/tree/appwidget-listview1)是一个似乎完全符合你需要的例子。 –