I am able to construct a LinearLayout of dozens of Views programmatically and to display it as the content view of an Activity. I am able to walk the LinearLayout tree and change the backgroundcolors of the Views.
And I am able to walk the tree and adjust the relative weights of the Views and display the tree using a call to setContentView() near the end of onCreate().
I have a seekBar to adjust the colors interactively, and that works. Similarly I have a seekBar to adjust the weights interactively. I know the weights are being changed correctly.
But somehow the view is not redisplayed after changing the weights interactively, whereas it is redisplayed after changing the colors interactively.
What do I have to do in order to redisplay the content view after changing the weights?
requestLayout()
works for me