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:
public int currentPrices[] = {0,0,0,0,0,0,0,0,0};
Now, my buyDialog class is as follows:
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);
} }
Eclipse persistently says that currentPrices can't be resolved. How do I link a child activity to the parent activity's variables?
I may have done my intent wrong, as I'm quite new at constructing them. But here's that line, from main:
case R.id.buyButton1:
currentRes = masterRes.get(0);
Intent intent = new Intent();
intent.setClass(main.this, buyDialog.class);
startActivity(intent);