Programmatically change the width of the Button in android
<p>How to change the Width of a button programmatically. I am able to change the height but the width does not change. Following is my code snippet</p>

<pre><code>private void createButton(final String label)
{

    Button button = new Button(this);
    button.setText(label);


    button.setWidth(10);
    button.setHeight(100);

    button.setOnClickListener(new OnClickListener() 
    {

        @Override
        public void onClick(View v) 
        {


        }
    });
    mMenuContainer.addView(button, mMenuItemLayoutParamters);


}
</code></pre>

<p>But the width of the button occupies the width of the screen.</p>
