title: Relative layout isn't working on Android Studio
body: <p>Basically, I'm learning Android development and am having trouble with adding a relative layout to my code. Inside the main linear layout, it simply won't work and I don't know how to add another outside (is that possible?). I don't know how to fix this and I would just like to know what I need to write in order to get a relative layout with some text in the top right corner, as I can't do this efficiently with a linear layout. Please help. The text I want in the top right corner is "Open from 8 AM to 6 PM on Mondays to Fridays \n \n Open from 9 PM to 5 PM on Saturdays and Sundays".</p>
  
  <p>Here is my code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      tools:context="com.example.janis.justjava.MainActivity"
      android:orientation="vertical"&gt;
      
      &lt;TextView
          android:paddingTop="16dp"
          android:paddingBottom="8dp"
          android:paddingLeft="16dp"
          android:paddingRight="16dp"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="Quantity"
          android:textAllCaps="true" /&gt;
  
      &lt;LinearLayout
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:orientation="horizontal"&gt;
  
          &lt;Button
              android:layout_width="38dp"
              android:layout_height="38dp"
              android:text="-"
              android:layout_marginTop="4dp"
              android:layout_marginBottom="8dp"
              android:layout_marginRight="16dp"
              android:layout_marginLeft="16dp"
              android:onClick="decrement"/&gt;
  
          &lt;TextView
              android:paddingTop="4dp"
              android:paddingBottom="8dp"
              android:paddingLeft="8dp"
              android:paddingRight="8dp"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:id="@+id/quantity_text_view"
              android:text="0"
              android:textColor="@android:color/black"/&gt;
  
          &lt;Button
              android:layout_width="38dp"
              android:layout_height="38dp"
              android:text="+"
              android:layout_marginTop="4dp"
              android:layout_marginBottom="8dp"
              android:layout_marginRight="16dp"
              android:layout_marginLeft="16dp"
              android:onClick="increment"/&gt;
  
      &lt;/LinearLayout&gt;
  
      &lt;TextView
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="Price"
          android:paddingTop="8dp"
          android:paddingBottom="8dp"
          android:paddingLeft="16dp"
          android:paddingRight="16dp"
          android:textAllCaps="true"/&gt;
  
      &lt;TextView
          android:paddingTop="8dp"
          android:paddingBottom="8dp"
          android:paddingLeft="16dp"
          android:paddingRight="16dp"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:id="@+id/price_text_view"
          android:text="Total: £0"
          android:textColor="@android:color/black"/&gt;
  
  
  &lt;/LinearLayout&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I can send my Java code too if that is helpful. </p>
  
  <p>Here is how the code looks on android studio:</p>
  
  <p><a href="https://i.stack.imgur.com/kLwLp.png" rel="nofollow noreferrer">Pic of the android studio with phone preview</a></p>