Android Screen Orientations:
<p><a href="https://i.stack.imgur.com/cpX9D.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cpX9D.png" alt="enter image description here"></a></p>

<p><a href="https://i.stack.imgur.com/eBD6J.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eBD6J.png" alt="enter image description here"></a></p>

<p>These orientations are shown correctly here, but when i run it and changes the orientations the landscape mode doesn't works and all the buttons are misplaced as<a href="https://i.stack.imgur.com/gVtis.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gVtis.png" alt="enter image description here"></a></p>

<p>what might the solution to this problem be?
XML for landscape mode.</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:background="@drawable/flowers"
android:id="@+id/frontpage_layout"

                              tools:context="com.example.hassidiczaddic.multiplescreensupport.MainActivity"&gt;

   &lt;RelativeLayout

    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/scrollView"&gt;

    &lt;Button
    android:layout_width="200dp"
    android:layout_height="50dp"
    android:text="OPEN"
    android:textSize="20sp"
    android:id="@+id/button.open"
    android:layout_alignParentTop="true"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true" /&gt;

   &lt;Button
    android:layout_width="200dp"
    android:layout_height="50dp"
    android:text="LARGE"
    android:textSize="20sp"
    android:id="@+id/button.large"
    android:layout_alignParentRight="true"
    android:layout_marginRight="86dp"
    android:layout_marginEnd="86dp"
    android:layout_toRightOf="@+id/button.rate"
    android:layout_toEndOf="@+id/button.rate" /&gt;

    &lt;Button
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textSize="20sp"

    android:text="Something"
    android:id="@+id/button.something"
    android:layout_marginTop="38dp"
    android:layout_below="@+id/button.open"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true"
    android:layout_toLeftOf="@+id/button.rate"
    android:layout_toStartOf="@+id/button.rate" /&gt;

    &lt;Button
    android:layout_width="wrap_content"

    android:textSize="20sp"
    android:layout_height="wrap_content"
    android:text="RATE"
    android:id="@+id/button.rate"
    android:layout_marginTop="38dp"
    android:layout_below="@+id/button.something"
    android:layout_toRightOf="@+id/button.open"
    android:layout_toEndOf="@+id/button.open" /&gt;

    &lt;Button
    android:layout_width="wrap_content"
    android:textSize="20sp"
    android:layout_height="wrap_content"
    android:text="CLOSE"
    android:id="@+id/button.close"
    android:layout_alignTop="@+id/button.something"
    android:layout_alignRight="@+id/button.large"
    android:layout_alignEnd="@+id/button.large"
    android:layout_toRightOf="@+id/button.rate"
    android:layout_toEndOf="@+id/button.rate" /&gt;
    &lt;/RelativeLayout&gt;

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