下面列出了怎么用android.widget.RemoteViewsService.RemoteViewsFactory的API类实例代码及写法,或者点击链接到github查看源代码。
public void testStartService() throws Exception {
Intent i = new Intent(getContext(), RssfeedWidgetService.class);
startService(i);
RssfeedWidgetService service = getService();
RemoteViewsFactory onGetViewFactory = service.onGetViewFactory(i);
assertNotNull(onGetViewFactory);
}
@Override
public RemoteViewsFactory onGetViewFactory(Intent intent) {
return new RssfeedWidgetViewsFactory(getApplicationContext(), intent);
}