草庐IT

onGetViewFactory

全部标签

android - onGetViewFactory 未调用

我正在为我的应用程序开发一个小部件,但我遇到了一个问题:我的android.widget.RemoteViewsService类的onGetViewFactory方法没有被调用!我的代码:Intent服务this.views=newRemoteViews(this.ctx.getPackageName(),i);IntentlocalIntent=newIntent(this.ctx,MyWidgetService.class);localIntent.putExtra("WidgetId",param);localIntent.setData(Uri.parse(localInten

android - onGetViewFactory 只为多个小部件调用一次

我有一个使用ListView的appwidget。我创建了一个扩展RemoteViewsService的类:publicclassAppWidgetServiceextendsRemoteViewsService{@OverridepublicRemoteViewsFactoryonGetViewFactory(Intentintent){return(newAppWidgetListFactory(this.getApplicationContext(),intent));}}在我的AppWidgetProvider中,我为小部件的每个实例(对于每个appWidgetId)调用以下方