title: addView causes NullPointerException
body: <p>Good day!
  I'm implementing aChartEngine to draw charts on Android and have faced with a trouble: I  receive NullPointerException when try to add created chart view to layout with addView method.</p>
  
  <p><strong>chart_layout.xml:</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:id="@+id/charts_relative_layout"
      android:orientation="vertical"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      &gt;
      &lt;LinearLayout
          android:name="@+id/price_chart"
          android:orientation="vertical"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"/&gt;
  // other elements
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>Charts.java</p>
  
  <pre><code>public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.chart_layout);
       //other code
  }
  
  
  protected void onResume() {
      super.onResume();
  
      if (chart_price == null) { 
      LinearLayout layout = (LinearLayout) findViewById(R.id.price_chart);
      chart_price = ChartFactory.getLineChartView(this, buildDataset(getTitles(), dateArray, priceArray), getRenderrer(paramList.get(0).length, paramList.get(1).length, maxPrice));          
      layout.addView(chart_price);    // THIS LINE CAUSES NULLPOINTEREXCEPTION
      }
      else {
        chart_price.repaint();
      }
   }
  </code></pre>
  
  <p>Are any ideas, what can be the reason of this error?</p>