public class areaActivity extends Activity {
Button movenextarea=(Button) findViewById(R.id.buttonnextexteriorwall);movenextarea.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { EditText areanumber1 = (EditText) findViewById(R.id.editTextplotarea); int plotarea1 = Integer.parseInt(areanumber1.getText().toString()); EditText areanumber2 = (EditText) findViewById(R.id.editTextcoveredarea); int coveredarea1 = Integer.parseInt(areanumber2.getText().toString()); double sqrt = (int) Math.sqrt(plotarea1); oneside = plotarea1; Intent secondActivity = new Intent (getApplicationContext(), roomActivity.class); secondActivity.putExtra("oneside", oneside); startActivity(secondActivity); startActivity(new Intent(getApplicationContext(), exteriorwallActivity.class)); }});
public class exteriorwallActivity extends Activity {
Button nextactivity1 = (Button) findViewById(R.id.buttonfoundationtype);nextactivity1.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { EditText exteriornumber1 = (EditText) findViewById(R.id.editTextinputlengthexterior); int noofwalls1 = Integer.parseInt(exteriornumber1.getText().toString()); Intent intent = getIntent(); int newPlotarea1 = getIntent().getIntExtra("oneside", 0); // int newPlotarea1 = getIntent().getExtras().getInt("NameOfVariable"); totallengthofwall = noofwalls * newPlotarea1; Context context = getApplicationContext(); CharSequence text = "Hello toast!"; int duration = Toast.LENGTH_SHORT; Toast toast = Toast.makeText(context,"Value is " + newPlotarea1, duration); toast.show(); }});