dynamic layout with two buttons problem
<p>how can I set my buttons in a linearLayout dynamically? So I want that all android mobiles with different display sizes can use my app.</p>

<p>Code</p>

<pre><code>&lt;LinearLayout android:id="@+id/linear_layout_main2" android:layout_width="fill_parent" 
android:layout_height="wrap_content" android:orientation="horizontal"&gt;

&lt;Button android:id="@+id/bt1" android:text="GO"   
style="@style/button_font" android:clickable="false"     
android:background="@drawable/box1" 
android:layout_marginLeft="6px" /&gt;

&lt;Button android:id="@+id/bt2" android:text="ON"   
style="@style/button_font" android:clickable="false"     
android:background="@drawable/box1" 
android:layout_marginLeft="6px" /&gt;

&lt;/LinearLayout&gt; 
</code></pre>

<p>Style-Code</p>

<pre><code>&lt;style name="button_font" parent="@android:style/TextAppearance.Medium"&gt;
    &lt;item name="android:layout_width"&gt;44px&lt;/item&gt;
    &lt;item name="android:layout_height"&gt;39px&lt;/item&gt;
    &lt;item name="android:textColor"&gt;#ffffffff&lt;/item&gt;
    &lt;item name="android:textSize"&gt;18px&lt;/item&gt;
    &lt;item name="android:layout_gravity"&gt;center_vertical&lt;/item&gt;
&lt;/style&gt;
</code></pre>
