title: Android center horizontal not working
body: <p>I got this code, a linearlayout inside relativelayout... however its not centering horizontally... any idea why? </p>
  
  <p>i want the linearlayout to be horizontall centered. i am filling it with images via code.</p>
  
  <pre><code> &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
       android:layout_height="match_parent"
       android:orientation="vertical" &gt;
      &lt;RelativeLayout
          android:id="@+id/relative1"
          android:layout_width="match_parent"
          android:layout_height="0px"
          android:layout_weight="10"
          android:background="@color/list_background_pressed" &gt;
          &lt;LinearLayout
              android:id="@+id/linear1"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:orientation="horizontal"
              android:layout_centerHorizontal="true" &gt;           
          &lt;/LinearLayout&gt;
          &lt;TextView
              android:id="@+id/text2"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_centerInParent="true"
              android:text="HI! Welcome to My Zain"
              android:textColor="#ffffff" /&gt;
          &lt;ImageView
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_below="@id/text2"
              android:layout_centerHorizontal="true"
              android:paddingTop="20dp"
              android:src="@drawable/ico_profile_1_64x64" &gt;
          &lt;/ImageView&gt;
      &lt;/RelativeLayout&gt;
      &lt;RelativeLayout
          android:id="@+id/relative2"
          android:layout_width="match_parent"
          android:layout_height="0px"
          android:layout_weight="10" &gt;
           &lt;TextView
              android:id="@+id/text5"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_centerHorizontal="true"
              android:text="The new Recharge Mechanism"
              android:textColor="#000000" /&gt;
      &lt;/RelativeLayout&gt;
  &lt;/LinearLayout&gt;
  </code></pre>