我想從窗口小部件中顯示的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)是一個似乎完全符合你需要的例子。 –