Android: alignment of images according to device size?
<p>I am having three images or buttons in a linear layout which fits fine on large devices, but when it comes to small devices, what should i do so that the third image comes in the next line (in small devices, it would be aligned properly in landscape but it would go out of the screen in the portrait mode).</p>

<p><img src="http://i.stack.imgur.com/bpMd9.png" alt="enter image description here"></p>

<p>XML code:</p>

<pre><code>        &lt;LinearLayout
            android:id="@+id/linearLayout7"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content" android:layout_marginLeft="5dp" android:layout_marginRight="5dp" android:layout_marginBottom="5dp" android:gravity="left" android:layout_gravity="left" android:fitsSystemWindows="true"&gt;

            &lt;ImageButton
                android:id="@+id/stopServiceButton"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/stop_service_button_selector" android:background="@null" android:layout_gravity="left" android:paddingBottom="5dp" android:paddingRight="5dp" android:paddingTop="5dp"/&gt;

            &lt;ImageButton
                android:id="@+id/calibrateButton"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/calibrate_button_selector" android:background="@null" android:layout_gravity="left" android:padding="5dp"/&gt;

            &lt;ImageButton
                android:id="@+id/doneButton"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/done_button_selector" android:background="@null" android:layout_gravity="left" android:padding="5dp"/&gt;

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