title: Beginner - using variables defined in one class in another class
body: <p>So, lets say in my main activity, i have an array declared like this, that im not having any problems using inside any of main's methods: </p>
  
  <pre><code>public int currentPrices[] = {0,0,0,0,0,0,0,0,0};
  </code></pre>
  
  <p>Now, my buyDialog class is as follows:</p>
  
  <pre><code>package foosh.Frontier;
  
  
  import android.app.Activity;
  import android.os.Bundle;
  import foosh.Frontier.*;
  
  public class buyDialog extends Activity {
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          // Be sure to call the super class.
          super.onCreate(savedInstanceState);
  
          currentPrices[0]=999;
  
          //insert setup magic here
          setContentView(R.layout.buydialog);
  }  }
  </code></pre>
  
  <p>Eclipse persistently says that currentPrices can't be resolved.  How do I link a child activity to the parent activity's variables?</p>
  
  <p>I may have done my intent wrong, as I'm quite new at constructing them.  But here's that line, from main:</p>
  
  <pre><code>case R.id.buyButton1: 
              currentRes = masterRes.get(0);
              Intent intent = new Intent();
              intent.setClass(main.this, buyDialog.class);
              startActivity(intent);
  </code></pre>