title: make it the GridLayout way in android
body: <p>Hello I have this Screen </p>
  
  <p><img src="https://i.stack.imgur.com/4Vd51.png" alt="enter image description here"></p>
  
  <p>that i made by this code .</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res/com.example.test.project"
      android:layout_width="match_parent"
      android:layout_height="match_parent" &gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:orientation="vertical" &gt;
  
          &lt;LinearLayout
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:orientation="horizontal" &gt;
  
              &lt;Button
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_weight="1"
                  app:layout_gravity="fill_horizontal"
                  android:text="1" /&gt;
  
              &lt;Button
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_weight="1"
                  app:layout_gravity="fill_horizontal"
                  android:text="2" /&gt;
  
              &lt;Button
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_weight="1"
                  app:layout_gravity="fill_horizontal"
                  android:text="3" /&gt;
          &lt;/LinearLayout&gt;
  
          &lt;LinearLayout
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:orientation="horizontal" &gt;
  
              &lt;Button
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_weight="1"
                  app:layout_gravity="fill_horizontal"
                  android:text="4" /&gt;
  
              &lt;Button
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_weight="1"
                  app:layout_gravity="fill_horizontal"
                  android:text="5" /&gt;
  
              &lt;Button
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_weight="1"
                  app:layout_gravity="fill_horizontal"
                  android:text="6" /&gt;
          &lt;/LinearLayout&gt;
  
          &lt;LinearLayout
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:orientation="horizontal" &gt;
  
              &lt;Button
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_weight="1"
                  app:layout_gravity="fill_horizontal"
                  android:text="7" /&gt;
  
              &lt;Button
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_weight="1"
                  app:layout_gravity="fill_horizontal"
                  android:text="8" /&gt;
  
              &lt;Button
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_weight="1"
                  app:layout_gravity="fill_horizontal"
                  android:text="9" /&gt;
          &lt;/LinearLayout&gt;
  
          &lt;LinearLayout
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:orientation="horizontal" &gt;
  
              &lt;Button
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_weight="1"
                  app:layout_gravity="fill_horizontal"
                  android:text="10" /&gt;
  
              &lt;Button
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_weight="1"
                  app:layout_gravity="fill_horizontal"
                  android:text="11" /&gt;
  
              &lt;Button
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_weight="1"
                  app:layout_gravity="fill_horizontal"
                  android:text="12" /&gt;
          &lt;/LinearLayout&gt;
      &lt;/LinearLayout&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>Is there a way to do it with <code>GridLayout</code> , i tried to have GridLayout but it works only with 2 buttons in a row ,but with 3 it doesnot work , i used the code in the <a href="https://stackoverflow.com/a/10033481/838793">this</a> answer? </p>