Graph Not Being Draw for Android achartengine App
I wrote a simple application that solves quadratic equations and I am using achartengine to graph the parabola. I am using the Trigonometric line graph demo that came with the library as a template and when I press my button that is supposed to graph the parabola a blank graph comes into view.Thanks and any help is appreciated. Here is my code, and I am using the the AbstractDemoChart in my project if that matters.

Main code for program: 

    package com.test.quad;
    import java.text.DecimalFormat;
    import java.util.List;
    import android.util.Log;
    import android.app.Activity;
    import android.content.Intent;
    import android.os.Bundle;
    import android.view.View;
    import android.widget.Button;
    import android.widget.EditText;
    import android.widget.TextView;

      public class QuadraticActivity extends Activity  {
	Button reset;
	Button solve;
	Button grapher;
	TextView labela1;
	TextView b1label;
	TextView c1label;
	TextView result1;
	TextView result2;
	EditText a1;
	EditText b1;
	EditText c1;
	public List<double[]> x,y;
	public double a, b, c;
	public double xStart = 0, xEnd = 0;
	public double xCurrent, range, step;
	double yCurrent;
	public double xStep;
	public int count = 100;
	Graph g = new Graph();

	
      /** Called when the activity is first created. */
   
      public  void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    
	    

         
        labela1 = (TextView)this.findViewById(R.id.labela1);
        b1label = (TextView)this.findViewById(R.id.b1label);
        c1label = (TextView)this.findViewById(R.id.c1label);
        result1 = (TextView)this.findViewById(R.id.result1);
        result2 = (TextView)this.findViewById(R.id.result2);
        
        a1 = (EditText)this.findViewById(R.id.a1);
        b1 = (EditText)this.findViewById(R.id.b1);
        c1 = (EditText)this.findViewById(R.id.c1);
        
        solve = (Button)this.findViewById(R.id.solve);
      
        
          reset = (Button)this.findViewById(R.id.reset);
       
        
          grapher = (Button)this.findViewById(R.id.grapher);
      }
      public void onClickHandler(View v) {
     switch(v.getId()){
    	
        case R.id.reset:
    		a1.setText("");
    		b1.setText("");
    		c1.setText("");
    		result1.setText("");
    		result2.setText("");
    		a=0;
    		b=0;
    		c=0;
    	break;
     case R.id.solve:
    		solveEquation();
    	break;
    	
     case R.id.grapher:
		
    	 Intent achartIntent = new Graph().execute(this);
     	
    		 startActivity(achartIntent);
    		 Log.d("debug", "clicked" );
    		 
       break;
    	}
    	
    	
    	
      }
   
       protected void solveEquation() {
 
    	try{
    		 a = Double.parseDouble(a1.getText().toString());
        	 b = Double.parseDouble(b1.getText().toString());
        	 c = Double.parseDouble(c1.getText().toString());
    	}
    		catch (NumberFormatException exception) {
    			result1.setText("Please enter a number");
    			result2.setText(" ");
    		}
    	finally{}
    	
    		
    	
    	if (a==0 && b==0 && c==0){
    		result1.setText(" ");
    		result2.setText(" ");
    	}
    	else{
    	double  yy, xx,x1, x2, x3;
    	double disc = (( b * b) - (4 * a * c));
    	
    	DecimalFormat fmt = new DecimalFormat("0.###");
    	
    	if (disc > 0){
    		double solution1 = ((-1 * b) - Math.sqrt(disc)) / ( 2 * a);
    		double solution2 = ((-1 * b) + Math.sqrt(disc)) / (2 * a);
    		result1.setText("Solution #1: " + fmt.format(solution1));
    		result2.setText("Solution #2: " + fmt.format(solution2));
    		
    		if (solution1 < solution2){
    			xStart = solution1 - 5;
	               xEnd = solution2 + 5; 
    		}
    		else{
    			 xStart = solution2 - 5;
	               xEnd = solution1 + 5; 
    		}
    	}
    	else if (disc == 0){
    		double oneSol = (-1 * b) / ( 2 * a);
    		result1.setText("One Solution: " + fmt.format(oneSol));
    		result2.setText("");
    		xStart = oneSol - 5;
	        xEnd = oneSol + 5;
    	}
    	else{
    		yy = (-1 * b) / (2 * a);
    		xx = ((b * b) - (4 * a * c));
    		x1 = Math.abs(xx);
    		x2 = Math.sqrt(x1);
    		x3 = (x2) / (2 * a);
    		result1.setText("Imaginary Solution #1: " + fmt.format(yy) + " - " + 
                fmt.format(x3)+"i" );
    		result2.setText("Imaginary Solution #2: " + fmt.format(yy) + " + " 
                +fmt.format(x3)+"i" );                       
    		xStart = (((-1 * b) - (x2)) / ( 2 * a)) - 5;
			xEnd = (((-1 * b) + (x2)) / (2 * a)) + 5;
    	}
    	 
          
         
    	
    	
	    
     }
     }
    	
     }
Code for Graph(using demo as template and extending AbstractDemoChart)
     package com.test.quad;

     import java.util.ArrayList;

     import java.util.List;

     import org.achartengine.ChartFactory;
     import org.achartengine.chart.PointStyle;
     import org.achartengine.renderer.XYMultipleSeriesRenderer;

     import android.content.Context;
     import android.content.Intent;
     import android.graphics.Color;

     /**
     * Quadratic
     */
     public class Graph extends AbstractDemoChart {
     /**
      * Returns the chart name.
     * @return the chart name
     */
     public String getName() {
      return "Quadratic Functions";
     }
  
     /**
     * Returns the chart description.
     * @return the chart description
     */
     public String getDesc() {
    return "Quadratic Graph";
    }
   
    /**
    * Executes the chart demo.
    * @param context the context
    * @return the built intent
    */
    public Intent execute(Context context) {
	  String[] titles = new String[] { "Function" };
	  QuadraticActivity c = new QuadraticActivity();

	   final int NUM_STEPS = 100;
	   double range = c.xEnd - c.xStart;
	   double stepSize = range / NUM_STEPS;

	   double xCurrent = c.xStart;

	   double[] xValueArr = new double[NUM_STEPS + 1];
	   double[] yValueArr = new double[NUM_STEPS + 1];

	   for (int i=0; i < xValueArr.length; xCurrent += stepSize, i++) {

	       double yCurrent = (c.a)*Math.pow(xCurrent, 2) + (c.b)*xCurrent + (c.c);
	       xValueArr[i] = xCurrent;
	       yValueArr[i] = yCurrent;
	   }

	   List<double[]> x = new ArrayList<double[]>();
	   x.add(xValueArr);

	   List<double[]> values = new ArrayList<double[]>();
	   values.add(yValueArr);

    
       int [] colors = new int[] { Color.BLUE };
       PointStyle[] styles = new PointStyle[] { PointStyle.POINT };
       XYMultipleSeriesRenderer renderer = buildRenderer(colors, styles);
       setChartSettings(renderer, "Graph of Quadratic Equation", "X", "Y", 0, 360, -1, 1,
        Color.GRAY, Color.LTGRAY);
      renderer.setXLabels(20);
      renderer.setYLabels(10);
      renderer.setShowGrid(true);
      return ChartFactory.getLineChartIntent(context, buildDataset(titles,x,values), 
      renderer);     
     }

      }
And just incase here is my Xml for the Manifest:
    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.test.quad"
      android:versionCode="1"
      android:versionName="1.0">
    <uses-sdk android:minSdkVersion="10" />

     <application android:label="@string/app_name" android:icon="@drawable/icon">
        <activity android:name=".QuadraticActivity"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
       </activity>
		<activity 
         android:name="org.achartengine.chartdemo.demo.chart.XYChartBuilder"/>                                          
        <activity android:name="org.achartengine.GraphicalActivity" />
		<activity android:name=".Graph" />
        </application>

        <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

        <uses-sdk android:minSdkVersion="10" android:targetSdkVersion="10"></uses-sdk>
        </manifest> 

Graph Not Being Draw for Android achartengine App
===

I wrote a simple application that solves quadratic equations and I am using achartengine to graph the parabola. I am using the Trigonometric line graph demo that came with the library as a template and when I press my button that is supposed to graph the parabola a blank graph comes into view.Thanks and any help is appreciated. Here is my code, and I am using the the AbstractDemoChart in my project if that matters.

Main code for program: 

    package com.test.quad;
    import java.text.DecimalFormat;
    import java.util.List;
    import android.util.Log;
    import android.app.Activity;
    import android.content.Intent;
    import android.os.Bundle;
    import android.view.View;
    import android.widget.Button;
    import android.widget.EditText;
    import android.widget.TextView;

      public class QuadraticActivity extends Activity  {
	Button reset;
	Button solve;
	Button grapher;
	TextView labela1;
	TextView b1label;
	TextView c1label;
	TextView result1;
	TextView result2;
	EditText a1;
	EditText b1;
	EditText c1;
	public List<double[]> x,y;
	public double a, b, c;
	public double xStart = 0, xEnd = 0;
	public double xCurrent, range, step;
	double yCurrent;
	public double xStep;
	public int count = 100;
	Graph g = new Graph();

	
      /** Called when the activity is first created. */
   
      public  void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    
	    

         
        labela1 = (TextView)this.findViewById(R.id.labela1);
        b1label = (TextView)this.findViewById(R.id.b1label);
        c1label = (TextView)this.findViewById(R.id.c1label);
        result1 = (TextView)this.findViewById(R.id.result1);
        result2 = (TextView)this.findViewById(R.id.result2);
        
        a1 = (EditText)this.findViewById(R.id.a1);
        b1 = (EditText)this.findViewById(R.id.b1);
        c1 = (EditText)this.findViewById(R.id.c1);
        
        solve = (Button)this.findViewById(R.id.solve);
      
        
          reset = (Button)this.findViewById(R.id.reset);
       
        
          grapher = (Button)this.findViewById(R.id.grapher);
      }
      public void onClickHandler(View v) {
     switch(v.getId()){
    	
        case R.id.reset:
    		a1.setText("");
    		b1.setText("");
    		c1.setText("");
    		result1.setText("");
    		result2.setText("");
    		a=0;
    		b=0;
    		c=0;
    	break;
     case R.id.solve:
    		solveEquation();
    	break;
    	
     case R.id.grapher:
		
    	 Intent achartIntent = new Graph().execute(this);
     	
    		 startActivity(achartIntent);
    		 Log.d("debug", "clicked" );
    		 
       break;
    	}
    	
    	
    	
      }
   
       protected void solveEquation() {
 
    	try{
    		 a = Double.parseDouble(a1.getText().toString());
        	 b = Double.parseDouble(b1.getText().toString());
        	 c = Double.parseDouble(c1.getText().toString());
    	}
    		catch (NumberFormatException exception) {
    			result1.setText("Please enter a number");
    			result2.setText(" ");
    		}
    	finally{}
    	
    		
    	
    	if (a==0 && b==0 && c==0){
    		result1.setText(" ");
    		result2.setText(" ");
    	}
    	else{
    	double  yy, xx,x1, x2, x3;
    	double disc = (( b * b) - (4 * a * c));
    	
    	DecimalFormat fmt = new DecimalFormat("0.###");
    	
    	if (disc > 0){
    		double solution1 = ((-1 * b) - Math.sqrt(disc)) / ( 2 * a);
    		double solution2 = ((-1 * b) + Math.sqrt(disc)) / (2 * a);
    		result1.setText("Solution #1: " + fmt.format(solution1));
    		result2.setText("Solution #2: " + fmt.format(solution2));
    		
    		if (solution1 < solution2){
    			xStart = solution1 - 5;
	               xEnd = solution2 + 5; 
    		}
    		else{
    			 xStart = solution2 - 5;
	               xEnd = solution1 + 5; 
    		}
    	}
    	else if (disc == 0){
    		double oneSol = (-1 * b) / ( 2 * a);
    		result1.setText("One Solution: " + fmt.format(oneSol));
    		result2.setText("");
    		xStart = oneSol - 5;
	        xEnd = oneSol + 5;
    	}
    	else{
    		yy = (-1 * b) / (2 * a);
    		xx = ((b * b) - (4 * a * c));
    		x1 = Math.abs(xx);
    		x2 = Math.sqrt(x1);
    		x3 = (x2) / (2 * a);
    		result1.setText("Imaginary Solution #1: " + fmt.format(yy) + " - " + 
                fmt.format(x3)+"i" );
    		result2.setText("Imaginary Solution #2: " + fmt.format(yy) + " + " 
                +fmt.format(x3)+"i" );                       
    		xStart = (((-1 * b) - (x2)) / ( 2 * a)) - 5;
			xEnd = (((-1 * b) + (x2)) / (2 * a)) + 5;
    	}
    	 
          
         
    	
    	
	    
     }
     }
    	
     }
Code for Graph(using demo as template and extending AbstractDemoChart)
     package com.test.quad;

     import java.util.ArrayList;

     import java.util.List;

     import org.achartengine.ChartFactory;
     import org.achartengine.chart.PointStyle;
     import org.achartengine.renderer.XYMultipleSeriesRenderer;

     import android.content.Context;
     import android.content.Intent;
     import android.graphics.Color;

     /**
     * Quadratic
     */
     public class Graph extends AbstractDemoChart {
     /**
      * Returns the chart name.
     * @return the chart name
     */
     public String getName() {
      return "Quadratic Functions";
     }
  
     /**
     * Returns the chart description.
     * @return the chart description
     */
     public String getDesc() {
    return "Quadratic Graph";
    }
   
    /**
    * Executes the chart demo.
    * @param context the context
    * @return the built intent
    */
    public Intent execute(Context context) {
	  String[] titles = new String[] { "Function" };
	  QuadraticActivity c = new QuadraticActivity();

	   final int NUM_STEPS = 100;
	   double range = c.xEnd - c.xStart;
	   double stepSize = range / NUM_STEPS;

	   double xCurrent = c.xStart;

	   double[] xValueArr = new double[NUM_STEPS + 1];
	   double[] yValueArr = new double[NUM_STEPS + 1];

	   for (int i=0; i < xValueArr.length; xCurrent += stepSize, i++) {

	       double yCurrent = (c.a)*Math.pow(xCurrent, 2) + (c.b)*xCurrent + (c.c);
	       xValueArr[i] = xCurrent;
	       yValueArr[i] = yCurrent;
	   }

	   List<double[]> x = new ArrayList<double[]>();
	   x.add(xValueArr);

	   List<double[]> values = new ArrayList<double[]>();
	   values.add(yValueArr);

    
       int [] colors = new int[] { Color.BLUE };
       PointStyle[] styles = new PointStyle[] { PointStyle.POINT };
       XYMultipleSeriesRenderer renderer = buildRenderer(colors, styles);
       setChartSettings(renderer, "Graph of Quadratic Equation", "X", "Y", 0, 360, -1, 1,
        Color.GRAY, Color.LTGRAY);
      renderer.setXLabels(20);
      renderer.setYLabels(10);
      renderer.setShowGrid(true);
      return ChartFactory.getLineChartIntent(context, buildDataset(titles,x,values), 
      renderer);     
     }

      }
And just incase here is my Xml for the Manifest:
    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.test.quad"
      android:versionCode="1"
      android:versionName="1.0">
    <uses-sdk android:minSdkVersion="10" />

     <application android:label="@string/app_name" android:icon="@drawable/icon">
        <activity android:name=".QuadraticActivity"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
       </activity>
		<activity 
         android:name="org.achartengine.chartdemo.demo.chart.XYChartBuilder"/>                                          
        <activity android:name="org.achartengine.GraphicalActivity" />
		<activity android:name=".Graph" />
        </application>

        <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

        <uses-sdk android:minSdkVersion="10" android:targetSdkVersion="10"></uses-sdk>
        </manifest> 
