title: Set RelativeLayout visibility to GONE does not affect children
body: <p>I have a RelativeLayout, call it <code>my_rel</code>, with a number of children. I use the <code>include</code> tag to include the <code>my_rel</code> into another layout. Anyway, When I set <code>my_rel</code>'s visibility to GONE, the children of <code>my_rel</code> are still visible? How do I prevent that from happening?</p>
  
  <p><strong>Here is the larger/envelop view</strong>:</p>
  
  <pre><code>&lt;RelativeLayout 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="#F0F1F3"
      tools:context=".CookingFiest" &gt;
  
      &lt;View
          android:layout_width="1dp"
          android:layout_height="fill_parent"
          android:layout_marginLeft="84dp"
          android:background="#CCCCCC" /&gt;
  
      &lt;View
          android:layout_width="4dp"
          android:layout_height="fill_parent"
          android:layout_marginLeft="85dp"
          android:background="#FFFFFFFF" /&gt;
  
      &lt;View
          android:layout_width="1dp"
          android:layout_height="fill_parent"
          android:layout_marginLeft="89dp"
          android:background="#CCCCCC" /&gt;
  
      &lt;ScrollView
          android:id="@+id/my_scroller"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:layout_marginBottom="5dip"
          android:isScrollContainer="false" &gt;
  
          &lt;LinearLayout
              android:id="@+id/timeline_view"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:orientation="vertical" /&gt;
      &lt;/ScrollView&gt;
  
      &lt;com.nothing.noevil.widget.HorizontalListView
          android:id="@+id/cool_stuff"
          android:layout_width="match_parent"
          android:layout_height="50dp"
          android:layout_above="@id/cool_stuff"
          android:layout_centerHorizontal="true"
          android:layout_marginBottom="10dp" /&gt;
  
      &lt;include
          android:id="@+id/appliance"
          android:layout_width="wrap_content"
          android:layout_alignParentTop="true"
          layout="@layout/kitchen" /&gt;
  
      &lt;RelativeLayout
          android:id="@+id/bottom_nav"
          android:layout_width="match_parent"
          android:layout_height="48dp"
          android:layout_alignParentBottom="true"
          android:layout_marginBottom="10dp"
          android:background="#00000000"
          android:clickable="true" &gt;
  
          &lt;ImageView
              android:id="@+id/cook"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_centerHorizontal="true"
              android:layout_marginLeft="5dp"
              android:layout_marginRight="5dp"
              android:clickable="true"
              android:onClick="oncookClicked"
              android:src="@drawable/match_here" /&gt;
  
          &lt;ImageView
              android:id="@+id/shoe"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_toLeftOf="@id/cook"
              android:clickable="true"
              android:onClick="onshoeClicked"
              android:src="@drawable/shoe" /&gt;
  
          &lt;ImageView
              android:id="@+id/pencil"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_toRightOf="@id/cook"
              android:clickable="true"
              android:onClick="onRiverClicked"
              android:src="@drawable/pencil" /&gt;
      &lt;/RelativeLayout&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p><strong>Here is the nested/included view</strong>:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="50dp"
      android:layout_marginTop="40dp"
      android:clickable="true"
      android:visibility="gone"
      android:onClick="mangoes" &gt;
  
      &lt;!-- Backgrounds --&gt;
  
      &lt;ImageView
          android:id="@+id/bkg_1"
          android:layout_width="match_parent"
          android:layout_height="25dp"
          android:layout_alignParentTop="true"
          android:background="#e8edf3" /&gt;
  
      &lt;ImageView
          android:id="@+id/bkg_2"
          android:layout_width="match_parent"
          android:layout_height="25dp"
          android:layout_alignParentBottom="true"
          android:background="#f6f6f6" /&gt;
  
      &lt;!-- Two timers --&gt;
  
      &lt;TextView
          android:id="@+id/orange"
          android:layout_width="65dp"
          android:layout_height="wrap_content"
          android:layout_alignBottom="@id/bkg_1"
          android:layout_alignParentLeft="true"
          android:layout_alignTop="@id/bkg_1"
          android:layout_marginBottom="3dp"
          android:layout_marginLeft="2dp"
          android:gravity="center_vertical"
          android:text=""
          android:textColor="#1083f0"
          android:textSize="12sp" /&gt;
  
      &lt;TextView
          android:id="@+id/apple"
          android:layout_width="65dp"
          android:layout_height="wrap_content"
          android:layout_alignBottom="@id/bkg_2"
          android:layout_alignParentLeft="true"
          android:layout_alignTop="@id/bkg_2"
          android:layout_marginLeft="2dp"
          android:layout_marginTop="5dp"
          android:gravity="center_vertical"
          android:text=""
          android:textColor="#555555"
          android:textSize="12sp"
          android:textStyle="bold" /&gt;
      &lt;!-- Spot icon --&gt;
  
      &lt;ImageView
          android:id="@+id/veggies"
          android:layout_width="50dp"
          android:layout_height="wrap_content"
          android:layout_alignBottom="@id/bkg_2"
          android:layout_alignTop="@id/bkg_1"
          android:layout_marginBottom="2dp"
          android:layout_marginRight="10dp"
          android:layout_marginTop="5dp"
          android:layout_toRightOf="@id/orange"
          android:background="#000000"
          android:padding="10dp"
          android:src="@drawable/img1" /&gt;
      &lt;!-- Descriptions --&gt;
  
      &lt;TextView
          android:id="@+id/sheo"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignBottom="@id/bkg_1"
          android:layout_alignTop="@id/bkg_1"
          android:layout_marginBottom="3dp"
          android:layout_toRightOf="@id/veggies"
          android:gravity="center_vertical"
          android:text=""
          android:textColor="#1083f0"
          android:textSize="12sp" /&gt;
  
      &lt;TextView
          android:id="@+id/chalks"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignBottom="@id/bkg_2"
          android:layout_alignParentRight="true"
          android:layout_alignTop="@id/bkg_2"
          android:layout_marginTop="3dp"
          android:layout_toRightOf="@id/veggies"
          android:gravity="center_vertical"
          android:text=""
          android:textColor="#555555"
          android:textSize="12sp"
          android:textStyle="bold" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>If I set GONE within xml it's fine. But if I set gone programmatically, it's ignored.</p>
  
  <pre><code>LayoutInflater mInflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
          kich = (RelativeLayout) mInflater.inflate(R.layout.kitchen, null);
          kich.setVisibility(View.GONE);
  </code></pre>