Square button android
<p>I want to make a button square with the width the same as the heigth.<br/>
I try <code>bt.setWidth(bt.getHeight())</code> but it doesn't work.<br/>
If I hardcode the width (<code>bt.setWidth(90)</code>) it works but I don't know the height so I can hardcoded it.</p>

<p>Here is some code. When I click on a button, it opens a dialog and this dialog must contain the square button.</p>

<pre><code>public class MyClass extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.myLayout);
    }

    public void doClick(View view) {
        final Dialog dialog = new Dialog(view.getContext());
        dialog.setContentView(R.layout.dialogLayout);
        dialog.setTitle("Title");

        Button bt = (Button) dialog.findViewById(R.id.myButton);
        bt.setWidth(bt.getHeight());
        bt.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                ...
            }
        });

        dialog.show();
    }   
}
</code></pre>

<p>How could I do it?</p>
