How to Add Width and Height to LayoutParams, in Java

public LinearLayout.LayoutParams (int width, int height) was added in API level 1
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)

lp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH.Parent);

3. Compile and run!

Resources:
http://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html#MATCH_PARENT