title: How do I programmatically add buttons into layout one by one in several lines?
body: <p>How to create a list of buttons one by one in several lines?
  I made this:
  </p>
  
  <pre><code>LinearLayout layout = (LinearLayout) findViewById(R.id.linear_layout_tags);
      for (int i = 1; i &lt; 10; i++) {
          Button btnTag = new Button(this);
          btnTag.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
          btnTag.setText("Button " + i);
          btnTag.setId(i);
          layout.addView(btnTag);
          ((Button) findViewById(i)).setOnClickListener(this);
      }
  </code></pre>
  
  <p>and got only one line:</p>
  
  <p><img src="https://i.stack.imgur.com/2rbJQ.png" alt="I got this"><br>
  <strong>How to go to the next line programmatically?</strong></p>