android - Programmatically add Linear layout with five buttons placed horizontally with same size in both landscape and portrait -
i have programmatically creating linear layout 5 buttons fixed size, when change orientation, buttons stretching in lanscape here code: linearlayout button_layout = new linearlayout(this); button_layout.setlayoutparams(new linearlayout.layoutparams(layoutparams.fill_parent, 100)); button_layout.setorientation(linearlayout.horizontal); button_layout.setbackgroundcolor(color.parsecolor("#dce1dc")); framelayout layout = new framelayout(this); layout.setlayoutparams(new linearlayout.layoutparams(20, 80, 1)); layoutparams params = (layoutparams) layout.getlayoutparams(); params.setmargins(30, 0, 30, 0); button = new button(this); a.setlayoutparams(params); a.settext("a"); button_layout.addview(a); button b = new button(this); b.setlayoutparams(params); b.settext("b"); button_layout.addview(b); button c = new button(this); c.setlayoutparams(params); c.settext("c"); button...