Set the height and width of layout, programmatically in android

Create the layout
LinearLayout linearLayout= (LinearLayout)findViewById(;

Gets the layout params that will allow you to resize the layout
LayoutParams Lparams =  linearLayout.getLayoutParams();

Changes the height and width by specified pixels
Lparams .height = 100;
Lparams .width = 100;


Popular posts from this blog

Clear the app data programmatically in android

convert an integer to a string in java

Print the large string values in android log cat.