When it comes to change the height of a layout dynamically, I usually set the desired dimensions using LayoutParams like:
RelativeLayout myView = (RelativeLayout) v.findViewById(R.id.myView);
RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(
RelativeLayout.LayoutParams.FILL_PARENT,
screenHeight);
myView.setLayoutParams(lp);
But there is this shorter version as well:
myView.getLayoutParams().height = screenHeight;
Both are working in my case, I would prefer the second version of course because is much simpler, but is there any difference between the two I need to be aware of?
Thanks!