title: how to create flexible layout with textview android
body: <p>I am developing an application and sharing a layout with multiple activity. In that layout i have 5  TextViews(and showing em as button) horizontally adjacent to each other now my problem is in some activity i dont need 1 or two TextView and i want the remaining textview to take full screen width of the layout by resizing itself.and these textviews are inside a linear layout.</p>
  
  <p>here is the layout code.</p>
  
  <pre><code>    &lt;LinearLayout
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_gravity="center"
          android:gravity="center"
          android:layout_margin="2dip"
          android:orientation="horizontal" &gt;
  
          &lt;TextView
              android:id="@+id/category"
              android:layout_width="wrap_content"
              android:layout_height="27dip"
              android:layout_marginRight="6dip"
              android:background="@drawable/button_an"
              android:gravity="center_horizontal|center_vertical"
              android:paddingBottom="2dip"
              android:paddingLeft="5dip"
              android:paddingRight="5dip"
              android:paddingTop="2dip"
              android:text="Explore by Category"
              android:textColor="#000000"
              android:textSize="9dip" /&gt;
  
          &lt;TextView
              android:id="@+id/location"
              android:layout_width="wrap_content"
              android:layout_height="27dip"
              android:layout_marginRight="6dip"
              android:background="@drawable/button_an"
              android:gravity="center_horizontal|center_vertical"
              android:paddingBottom="2dip"
              android:paddingLeft="5dip"
              android:paddingRight="5dip"
              android:paddingTop="2dip"
              android:text="Search by Location"
              android:textColor="#000000"
              android:textSize="9dip" /&gt;
  
          &lt;TextView
              android:id="@+id/date"
              android:layout_width="35dip"
              android:layout_height="27dip"
              android:layout_marginRight="6dip"
              android:background="@drawable/button_an"
              android:gravity="center_horizontal|center_vertical"
              android:paddingBottom="2dip"
              android:paddingLeft="5dip"
              android:paddingRight="5dip"
              android:paddingTop="2dip"
              android:text="Date"
              android:textColor="#000000"
              android:textSize="9dip" /&gt;
  
          &lt;TextView
              android:id="@+id/mylocation"
              android:layout_width="wrap_content"
              android:layout_height="27dip"
              android:layout_marginRight="6dip"
              android:background="@drawable/button_an"
              android:gravity="center_horizontal|center_vertical"
              android:paddingBottom="2dip"
              android:paddingLeft="5dip"
              android:paddingRight="5dip"
              android:paddingTop="2dip"
              android:text="My Location"
              android:textColor="#000000"
              android:textSize="9dip" /&gt;
  
          &lt;TextView
              android:id="@+id/namesearch"
              android:layout_width="wrap_content"
              android:layout_height="27dip"
              android:background="@drawable/button_an"
              android:gravity="center_horizontal|center_vertical"
              android:paddingBottom="2dip"
              android:paddingLeft="5dip"
              android:paddingRight="5dip"
              android:paddingTop="2dip"
              android:text="Search by Name"
              android:textColor="#000000"
              android:textSize="9dip" /&gt;
      &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Thanks in advance for any help.</p>