Android - Center TextView Horizontally in LinearLayout
<p>I have the following basic layout</p>

<pre><code>&lt;LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"&gt;

&lt;LinearLayout
    android:orientation="horizontal"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:background="@drawable/title_bar_background"&gt;

    &lt;TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:padding="10dp"
        android:text="HELLO WORLD" /&gt;

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

<p>It seems like the xml is correct but the text is aligned to the left. The textview takes up the entire width of the parent and the textview is set to be centered. Not sure what the problem is...</p>
