Create Buttons for activity in code
<p>I dont't see last button (bx), when first button array too big, for example size is 12, when size is 2 I see it. Why button doesn't     transition to second row.</p>

<pre><code>protected void onCreate(Bundle savedInstanceState) 
    {
        super.onCreate(savedInstanceState);
        LinearLayout linLayout = new LinearLayout(this);
        linLayout.setOrientation(LinearLayout.HORIZONTAL); 
        LayoutParams linLayoutParam = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); 
        setContentView(linLayout, linLayoutParam);
        int size=20;
        Button[] mButtonsArray = new Button[size];

        LayoutParams Lpx= new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);

        for (int i=0; i&lt; size;i++) 
        {
       mButtonsArray[i]= new Button(this);
            mButtonsArray[i].setText(name);
            linLayout.addView(mButtonsArray[i], Lpx);
        }
       Button bx = new Button(this);
       bx.setText("back");
        linLayout.addView(bx, Lpx);
    }
</code></pre>
