Parameters:
width - the width, either MATCH_PARENT, WRAP_CONTENT or a fixed size in pixels
height - the height, either MATCH_PARENT, WRAP_CONTENT or a fixed size in pixels
1. Declare a LayoutParams, in Java, named lp.
2. In the MainActivity.java, in the onCreate method, add the below line. This will set the LinearLayout.LayoutParams width to MATCH_PARENT and height to MATCH_PARENT.
** For API Level < 8, use fill_parent
** For API Level 8+, use match_parent (fill_parent is deprecated)
3. Compile and run!
Resources:
http://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html#MATCH_PARENT