Within my widget, i'm using the following to dynamically add items (R.layout.widget_item) to a LinearLayout defined within my main widget layout:
//-- Main widget layout
RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget_design);
//-- Add to main layout
RemoteViews newView = new RemoteViews(context.getPackageName(), R.layout.widget_item);
views.addView(R.id.view_container, newView);
My question is, how can I dynamically set the "android:layout_weight" attribute on the newView?