Вы можете попробовать использовать setLayoutParams()
myViewGroup.setLayoutParams(new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT));
См. здесь описания параметров для LayoutParams
public ViewGroup.LayoutParams (int width, int height)
Creates a new set of layout parameters with the specified width and height.
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