The format of my XML file is as following:
LinearLayout ScrollView RelativeLayout LinearLayout
If you want to change the height of list view dynamically, you could use,
list.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, theSizeIWant));