android:layout_gravity="center_horizontal" in Java code
<p>I have added a Button to a view in java code.  Basically I want to add the xml</p>

<pre><code>android:layout_gravity="center_horizontal"
</code></pre>

<p>to the Button but do this in Java code, how is this done?</p>
