私は自分で解決しました。多くの試行錯誤の後に。私はここに私の解決策を掲載すると思った。
1つの場所を表すのに必要なビューを含むentity.xmlというxml.fileを作成しました。また、空のlinearLayoutを含むwidgetLayout.xmlという別のxmlファイルを作成します。
次に、ウィジェットレイアウトを動的に作成したいときにこれを行います。
RemoteViews main = new RemoteViews(getApplicationContext().getPackageName(), R.layout.widget_layout);
main.removeAllViews(R.id.main);
RemoteViews location = new RemoteViews(getApplicationContext().getPackageName(), R.layout.entity);
location.setTextViewText(R.id.SpotName, "loc");
RemoteViews location2 = new RemoteViews(getApplicationContext().getPackageName(), R.layout.entity);
spot1.setTextViewText(R.id.SpotName, "loc2");
main.addView(R.id.main, location);
main.addView(R.id.main, location2);
int[] allWidgetIds = intent.getIntArrayExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS);
AppWidgetManager.getInstance(getApplicationContext()).updateAppWidget(allWidgetIds[0], main);
修正のおめでとう!あなたができるときは、答えが「受け入れられた」とマークして、あなたの解決策が同じ問題を持つ他の人にもアクセスできるようにしてください。乾杯〜 –