Why is android trying to read an xml layout file from the /res/layout when I have created the layout in code?
问题 This question is in respect to RemoteViews. It works as it should in normal activities, but not in widgets: I have that in my ids.xml: <item type="layout" name="linear_layout_for_widget"></item> I have this in my WidgetProvider class: RemoteViews remoteViews = new RemoteViews(context.getPackageName(), R.layout.widget4x1_layout); LinearLayout linearLayoutForWidget = layout4x1Provider.createLinearLayoutForWidget(backgroundColor, textColor, borderColor, borderWidth, false); RemoteViews