title: Programmatically add Linear layout with five buttons placed horizontally with same size in both landscape and portrait
body: <p>i have programmatically creating linear layout with five buttons with fixed size, but when i change the orientation, the buttons are stretching in lanscape</p>
  
  <p>here is my code:</p>
  
  <pre><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 A = 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_layout.addView(C);
      Button D = new Button(this);
      D.setLayoutParams(params);
      D.setText("D");
      button_layout.addView(D);
      Button E = new Button(this);
      E.setLayoutParams(params);
      E.setText("E");
      button_layout.addView(E);
      linearLayout.addView(button_layout); //added button layout. 
  
      LinearLayout bottomBarLayout = new LinearLayout(this);
      bottomBarLayout.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, 50));
      bottomBarLayout.setOrientation(LinearLayout.HORIZONTAL);
      bottomBarLayout.setBackgroundColor(Color.parseColor("#8BC66D"));
      linearLayout.addView(bottomBarLayout); //added bottomBar layout .
  </code></pre>
  
  <p>below is my screen shots:</p>
  
  <p>I want the buttons to be square in both the orientations with equal spaces, how to achieve this?</p>