title: Center content of TextView vertically & horizontally - LinearLayout
body: <p>I am trying to center the context of a TextView vertically and horizontally.  Please see the below screenshot.</p>
  
  <p><img src="https://i.stack.imgur.com/apimU.png" alt="enter image description here"></p>
  
  <p>The TextViews that say <code>1-5</code> and <code>100+ Points</code> are the ones I want centered vertically and horizontally.  As you can see, they are center horizontally but not vertically.  Below is the code I am using.</p>
  
  <pre><code>    &lt;LinearLayout
          android:id="@+id/linearlayout2"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:orientation="vertical" &gt;
  
          &lt;LinearLayout
              android:layout_width="fill_parent"   
              android:layout_height="wrap_content"
              android:orientation="horizontal" &gt;
  
              &lt;TextView 
                  android:id="@+id/l1"
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_weight="2"
                  android:paddingTop="5dp"
                  android:paddingLeft="5dp"
                  android:paddingRight="5dp"
                  android:paddingBottom="5dp"
                  android:textSize="12sp"
                  android:gravity="center_vertical|center_horizontal" /&gt; 
  
              &lt;TextView 
                  android:id="@+id/g1"
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_weight="4"
                  android:paddingTop="5dp"
                  android:paddingLeft="5dp"
                  android:paddingRight="5dp"
                  android:paddingBottom="5dp"
                  android:textSize="12sp"
                  android:gravity="center_vertical|center_horizontal" /&gt; 
  
              &lt;TextView 
                  android:id="@+id/c1"
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_weight="4"
                  android:paddingTop="5dp"
                  android:paddingLeft="5dp"
                  android:paddingRight="5dp"
                  android:paddingBottom="5dp"
                  android:textSize="12sp"
                  android:gravity="center_vertical|center_horizontal" /&gt;
          &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Again, this question is how to center the content of the TextViews, not how to center the TextViews in the LinearLayout.  So, how do I center the content both ways in the TextViews?</p>