• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Setting Weight in Java code

I have created a view that extends a LinearLayout and added a few children for it (mostly textViews). I want to set the weight (and possibly other attributes) of these children, but do not know how to do this unless I use xml.

Is there a way to set the weight in java code?

or

Is there a way to set the children of the linearlayout in my class using xml?
 
Back
Top Bottom