title: How do you pass a float[] array between activities in android?
body: <p>class1.java has creates a float[] array that is need to have in class2.java. How do you do this? The float[] is points. Here is an example code:</p>
  
  <pre><code>class1.java
  
      import android.app.Activity;
      import android.content.Context;
      import android.app.ListActivity;
      import android.content.Intent;
      import android.graphics.Canvas;
      import android.graphics.Color;
      import android.graphics.Paint;
      import android.graphics.Typeface;
      import android.view.Display;
      import android.view.SurfaceHolder;
      import android.os.Bundle;
      import android.view.View;
      import android.view.View.OnClickListener;
      import android.widget.AdapterView;
      import android.widget.ArrayAdapter;
      import android.widget.Button;
      import android.widget.EditText;
      import android.widget.Spinner;
      import android.widget.TextView;
  
      public class class1 extends Activity  implements OnClickListener {
              public void onCreate(Bundle savedInstanceState) {
              super.onCreate(savedInstanceState);
              setContentView(R.layout.main);
  
              float[] points = new float[100];
              }
      }
  
  
  class2.java
  
  
  
   import android.app.Activity;
      import android.app.ListActivity;
      import android.content.Context;
      import android.content.Intent;
      import android.graphics.Canvas;
      import android.graphics.Color;
      import android.graphics.DashPathEffect;
      import android.graphics.Paint;
      import android.graphics.Path;
      import android.graphics.Rect;
      import android.os.Bundle;
      import android.view.View;
      import android.view.View.OnClickListener;
      import android.widget.AdapterView;
      import android.widget.ArrayAdapter;
      import android.widget.Button;
      import android.widget.EditText;
      import android.widget.Spinner;
      import android.widget.TextView;
  
      public class graph extends Activity{
  
       DemoView demoview;
       public void onCreate(Bundle savedInstanceState) {
              super.onCreate(savedInstanceState);
              demoview = new DemoView(this);
              setContentView(demoview);
  
       }
       private class DemoView extends View{
        public DemoView(Context context){
         super(context);
        }
  
        @Override protected void onDraw(Canvas canvas) {
         super.onDraw(canvas);
  
         canvas.drawLines(points, paint);
  
        }
       }
      }
  </code></pre>