Determines whether the layout will be a column or a row.
Related XML Attributes: android:orientation
Parameters: orientation - Pass HORIZONTAL or VERTICAL. Default value is HORIZONTAL.
1. Instantiate a new LinearLayout object, in Java or Create a LinearLayout xml file in the layouts directory. The LinearLayout should be named myLinearLayout.
2. To create the widgets within a LinearLayout vertically, add this line below.
myLinearLayout.setOrientation(LinearLayout.VERTICAL);
myLinearLayout.setOrientation(LinearLayout.VERTICAL);
3. To create the widgets within a LinearLayout horizontally, add this line below. Horizontal is the default if no setOrientation is selected.
myLinearLayout.setOrientation(LinearLayout.HORIZONTAL);
4. Compile and run!
http://developer.android.com/reference/android/widget/LinearLayout.html#setOrientation(int)
http://developer.android.com/guide/topics/ui/layout/linear.html
http://stackoverflow.com/questions/17841003/alertdialog-with-2-textbox-doesnt-work-correctly