title: android setVisibility ui display strangely
body: <p><strong>My english is poor,if you don't understand what I mean,please tell me,thanks.</strong></p>
  
  <p>My data stored in SQLiteDatabase,I use listview to show my data.and I implement collapse/expand myself via ListActivity.onItemClick(). but when childview.setVisibility(View.GONE),sometimes android ui show half, I'm new user of stack overflow, and I can't post images.</p>
  
  <p>1)default display:expanded all groups</p>
  
  <p>The images link to another website,</p>
  
  <p>2)<a href="http://mblogpic.store.qq.com/mblogpic/926b9b102c63023bf154/460" rel="nofollow">collapsed all groups</a></p>
  
  <p>3)<a href="http://mblogpic.store.qq.com/mblogpic/2c4422cc604cf0ba2a4c/460" rel="nofollow">when several times clicked on listview's item,the main activity showed only half of window height</a></p>
  
  <p>what's wrong with my solution. or it's android bug?</p>
  
  <p>this is code:</p>
  
  <pre><code>@Override
      public void onListItemClick(ListView list,View v,int position,long id) {
          if(v instanceof RelativeLayout) {
              ViewGroup group = (ViewGroup)v;
              ImageView groupIndicator = (ImageView) group.getChildAt(0);
              TextView itemContentView = (TextView) group.getChildAt(2);
              if(itemContentView.getVisibility() == View.GONE) {
                  groupIndicator.setBackgroundResource(R.drawable.expand);
                  itemContentView.setVisibility(View.VISIBLE);
              } else {
                  groupIndicator.setBackgroundResource(R.drawable.collapse);
                  itemContentView.setVisibility(View.GONE);
              }
          }
      } 
  </code></pre>
  
  <p>this is listview's layout xml.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:background="@drawable/corner"
    android:padding="3dip"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"&gt;
    &lt;ImageView android:id="@+id/groupIndicator" android:background="@drawable/expand" android:layout_width="wrap_content" android:layout_height="wrap_content"/&gt;
    &lt;TextView android:id="@+id/rowTitle" android:paddingLeft="5dip" android:textColor="#FFFFFF" android:textStyle="bold" android:layout_toRightOf="@id/groupIndicator" android:layout_width="wrap_content" android:layout_height="wrap_content"/&gt;
    &lt;TextView android:id="@+id/rowContent" android:layout_below="@id/groupIndicator" android:padding="5dip" android:layout_width="fill_parent" android:layout_height="wrap_content"/&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>