title: Android LinearLayout not displaying
body: <p>I have a problem with my xml. I have a LinearLayout which contains a chart (aChartEngine library) and if i set the height to 480dp it shows the chart, if i set the height to wrap_content, nothing shows. I think there is a problem with the parent or something. Here is the entire xml file.</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"
  
  tools:context=".Sniffer" &gt;
  
  &lt;TabHost
      android:id="@+id/tabHost"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:layout_alignParentLeft="true"
      android:layout_alignParentTop="true"
      android:background="@color/black" &gt;
  
      &lt;ScrollView
          android:layout_width="match_parent"
          android:layout_height="match_parent" &gt;
  
          &lt;LinearLayout
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:orientation="vertical" &gt;
  
              &lt;TabWidget
                  android:id="@android:id/tabs"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:background="@color/white" &gt;
              &lt;/TabWidget&gt;
  
              &lt;FrameLayout
                  android:id="@android:id/tabcontent"
                  android:layout_width="match_parent"
                  android:layout_height="match_parent" &gt;
  
                  &lt;LinearLayout
                      android:id="@+id/tab1"
                      android:layout_width="match_parent"
                      android:layout_height="match_parent"
                      android:paddingLeft="10dp"
                      android:paddingRight="10dp"
                      android:orientation="vertical" &gt;
  
                     &lt;!-- removed some content here, 2 much space and not relevant --&gt;
  
                  &lt;/LinearLayout&gt;
  
                  &lt;LinearLayout
                      android:id="@+id/tab2"
                      android:layout_width="match_parent"
                      android:layout_height="match_parent"
                      android:paddingLeft="10dp"
                      android:paddingRight="10dp"
                      android:orientation="vertical" &gt;
  
                      &lt;View
                        android:layout_width="1dp"
                        android:layout_height="30dp"&gt;
                      &lt;/View&gt;
  
                      &lt;View
                          style="@style/Divider"
                          android:background="@color/semi_transparent"/&gt;
  
                  &lt;/LinearLayout&gt;
  
                  &lt;LinearLayout
                      android:id="@+id/tab3"
                      android:layout_width="match_parent"
                      android:layout_height="match_parent"
                      android:paddingLeft="10dp"
                      android:paddingRight="10dp"
                      android:orientation="vertical" &gt;
  
                      &lt;View
                        android:layout_width="1dp"
                        android:layout_height="30dp"&gt;
                      &lt;/View&gt;
  
                      &lt;View
                          style="@style/Divider"
                          android:background="@color/semi_transparent"/&gt;
  
                  &lt;/LinearLayout&gt;
  
                   &lt;LinearLayout
                      android:id="@+id/tab4"
                      android:layout_width="match_parent"
                      android:layout_height="match_parent"
                      android:paddingLeft="10dp"
                      android:paddingRight="10dp"
                      android:orientation="vertical" &gt;
  
                      &lt;View
                        android:layout_width="1dp"
                        android:layout_height="30dp"&gt;
                      &lt;/View&gt;
  
                      &lt;LinearLayout
                          android:id="@+id/chart"
                          android:layout_width="match_parent"
                          android:layout_height="500dp"                    
                          android:orientation="horizontal"&gt;
                      &lt;/LinearLayout&gt;
  
                  &lt;/LinearLayout&gt;
              &lt;/FrameLayout&gt;
          &lt;/LinearLayout&gt;
      &lt;/ScrollView&gt;
  &lt;/TabHost&gt;
  </code></pre>
  
  <p></p>
  
  <p>Under tab4 there is a LinearLayout with chart id. That is where i place my chart. I tried using weight attribute and 0dip but still not working, only with a fixed height.</p>
  
  <p>LE: The LinearLayout is empty because I add contents to it programatically.</p>
  
  <p>Code snippet for chart.</p>
  
  <pre><code>public void createGraphCPU(List&lt;BasicNameValuePair&gt; values){
  
      mSeries = new CategorySeries("");
      mRenderer = new DefaultRenderer();
      statisticsTab.removeAllViews();
  
      Collections.shuffle(COLORS_LIST);
      for(int i=0;i&lt;values.size();i++){
          double value=Double.parseDouble(values.get(i).getValue());
          mSeries.add( values.get(i).getName(),value );
          SimpleSeriesRenderer renderer = new SimpleSeriesRenderer();
          renderer.setColor(COLORS_LIST.get(i%COLORS_LIST.size()));
          renderer.setDisplayChartValues(true);
          mRenderer.addSeriesRenderer(renderer);
      }
  
       mRenderer.setChartTitleTextSize(20); 
       mRenderer.setChartTitle("CPU Energy Consumption");
       mRenderer.setLabelsTextSize(15);  
       mRenderer.setLegendTextSize(15);  
       mRenderer.setMargins(new int[] { 20, 15, 15, 0 });  
       mRenderer.setZoomButtonsVisible(true);  
  
       if (mChartView != null) {
            mChartView.repaint();
      }
       else{
           mChartView = ChartFactory.getPieChartView(this, mSeries,mRenderer);
          statisticsTab.addView(mChartView, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
       }
  
  }
  </code></pre>