I have this code in my application:
LinearLayout.LayoutParams params =
new LinearLayout.LayoutParams(WRAP_CONTENT, WRAP_CONTENT);
and I
You need to instance LinearLayout. After that you can call setOrientation()
LinearLayout myLayout = ...;
myLayout.setLayoutParams(new LayoutParams(LinearLayout.WRAP_CONTENT, LinearLayout.WRAP_CONTENT);
myLayout.setOrientation(LinearLayout.VERTICAL);
That should do the job :)
For more infos check the Android API.