I have two relative layouts. Both have width of fill parent and height of 100 dip. My requirement is when I click the first layout it should shrink to 50dip height and the o
In onClick Listener add this code.
Button button = (Button) findViewById(view.getId()); LinearLayout rLGreen = ((LinearLayout) button.getParent()); rLGreen.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
It will work.