title: How do you set button layout parameters in a loop?
body: <p>I have 9 (programmatically generated) buttons.  I do this for all of them:</p>
  
  <pre><code>Button btnButton1 = new Button(this);
  btnButton1.setText(getText(R.string.button_1));
  btnButton1.setTextSize(BUTTON_TEXT_SIZE);
  btnButton1.setHeight(BUTTON_HEIGHT);
  btnButton1.setWidth(BUTTON_WIDTH);
  btnButton1.setOnClickListener(buttonClicked(btnButton1));
  </code></pre>
  
  <p>(where buttonClicked is this:</p>
  
  <pre><code>  private final View.OnClickListener buttonClicked(final Button button)
    {
      return new View.OnClickListener()
      {
        public void onClick(View v)
        {
          tvButtons.append(button.getText().toString());
        }
      };        
    };
  </code></pre>
  
  <p>and tvButtons is a TextView.
  )</p>
  
  <p>Is there a way I can do something like:</p>
  
  <pre><code>for (button : buttons)
  {
     button.setText &amp;c. &amp;c.
  }
  </code></pre>
  
  <p>to reduce the duplication in the code?</p>