I have this code in my application:
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(WRAP_CONTENT, WRAP_CONTENT);
and I
Simply use as follow :-
LinearLayout mlayout = new LinearLayout(context); mlayout.setOrientation(2);
2 means Vertical, 1 is used for horizontal.
Vertical
horizontal