Displaying extended Views on android
===

I have created my own extension of View to display custom graphs, but seem to be running into problems displaying multiple instances of my custom class. When I run the program, I get no errors, but only display one graph when I am trying to display two. I assume I have some error in my approach to extending View or my approach to the html layout.

My GraphView.java class:
<pre>

    package com.xxx.yyy;
    
    import View;
    ...
    
    public class GraphView extends View{
    	
    
    	public GraphView(Context context, AttributeSet set) {
    		super(context, set);		
    		init();
    	}
    	
    	public GraphView(Context context) {
    		super(context);
    		init();		
    	}
    	
    	public void init(){
                    ...
    		//set display constants, axis values, and Paint objects
    	}
    	
    	public void setData(long[] passX, float[] passY){
                    ...
    		//get data to graph	
    	}
    		
    	@Override
    	protected void onDraw(Canvas passCanvas){
                    ...
    		//draw's the graph onto the view
    	}//onDraw
    }

</pre>
Main.xml:



    
    <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical" >
    
    
    <com.xxx.yyy.GraphView
        android:id="@+id/x_0" 
        android:layout_width = "fill_parent"
        android:layout_height="wrap_content"/>
    
    <com.xxx.yyy.GraphView
        android:id="@+id/y_0" 
        android:layout_width = "fill_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/x_0"/>
    
    <TextView
        android:id="@+id/text1"
        android:layout_width = "wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@id/y_0"
        android:text="testing 123"/>
    
    </RelativeLayout>


and my Activity:

<pre>

    package com.xxx.yyy;
    
    import android.app.Activity;
    ...
    import android.widget.TextView;
    
    public class AccelDataStats extends Activity{
    
    	private GetAccelData mApp;
    	@Override
    	protected void onCreate(Bundle savedInstanceState){
    		super.onCreate(savedInstanceState);
    		setContentView(R.layout.Main);
    		
    		
    		mApp = (GetAccelData) GetAccelData.getContext(); //gets context from previous activity
    		
    		GraphView x_0 = (GraphView) findViewById(R.id.x_0);
    		x_0.setData(mApp.t, mApp.x[0]);
    		x_0.setTitle("x_0 testing");
    		
    		GraphView y_0 = (GraphView) findViewById(R.id.y_0);
    		y_0.setData(mApp.t, mApp.y[0]);
    		y_0.setTitle("y_0 123");		
    	}	
    }

</pre>

How can a display multiple instances of my GraphView.java? Thank you so much for the help.