i want to place a `textview` in the center of a `linearlayout` but i am having problems with it. my `linearlayout` is match\_parent in layout\_width. `textview` is centered by assigning center to layout\_gravity. `textview` is wrap\_content in layout\_width. here is my xml file

```
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/background"
    android:orientation="vertical" >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >

        <TextView
            android:id="@+id/textView1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:text=" Text"
            android:textSize="40sp"
            android:textStyle="bold"
            android:typeface="monospace" />
    </LinearLayout>

</LinearLayout>

```