How to Add Views to the Scroll View in Android?
<p>I create the following code to create the Bar Chart and Pie Chart using Canvas.</p>

<p>Here is my code</p>

<pre><code>public class ChartDemo extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    //ScrollView sv = new ScrollView(this);

    LinearLayout llay = new LinearLayout(this);
    llay.setOrientation(LinearLayout.VERTICAL);

    float[] values = { 50, 100, 50, 20, 30, 60, 100, 90 };

    // Bar Chart
    BarGraph BarChart = new BarGraph(this, values);
    llay.addView(BarChart);

    //Pie Chart
    PieChartView Pie = new PieChartView(this, values);
    llay.addView(Pie);

    //sv.addView(llay);

    setContentView(llay);
    //setContentView(sv);
   }
 }
</code></pre>

<p>The above code show the BarChart only.
I change my code like the following it gives the Black(blank)Screen only.With out no error and exception</p>

<pre><code>  public class ChartDemo extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    ScrollView sv = new ScrollView(this);

    LinearLayout llay = new LinearLayout(this);
    llay.setOrientation(LinearLayout.VERTICAL);

    float[] values = { 50, 100, 50, 20, 30, 60, 100, 90 };

    // Bar Chart
    BarGraph BarChart = new BarGraph(this, values);
    llay.addView(BarChart);

    //Pie Chart
    PieChartView Pie = new PieChartView(this, values);
    llay.addView(Pie);

    sv.addView(llay);

    setContentView(sv);
   }
 }
</code></pre>

<p>And i create my Chart Views like the following </p>

<pre><code>public class PieChartView extends View {

private float[] Values; 

public PieChartView(Context context, float[] Values) {
    super(context);

    this.Values = Values;

}

protected void onDraw(Canvas canvas) {
    super.onDraw(canvas);

               .......
               .........

        }


}
</code></pre>

<p>I need to add both chart in Single Screen with Scroll View . But i am not able to add Both in the single Activity.How to do this ?? </p>
