package com.example.myapplication; import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.ArrayAdapter; import android.widget.EditText; import android.widget.Spinner; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Spinner dropdown = (Spinner)findViewById(R.id.theOperators); String[] operators = new String[]{"+", "-", "*","/"}; ArrayAdapter adapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_dropdown_item, operators); dropdown.setAdapter(adapter); } public void goNextPage(View myV){ Intent myIntent=new Intent(this, Main2Activity.class); EditText value1=(EditText)findViewById(R.id.value1); EditText value2=(EditText)findViewById(R.id.value2); Spinner theOperators=(Spinner)findViewById(R.id.theOperators); String theOperatorValue= theOperators.getSelectedItem().toString(); double theValue1=Double.parseDouble(value1.getText().toString()); double theValue2=Double.parseDouble(value2.getText().toString()); myIntent.putExtra("theValue1Extra",theValue1); myIntent.putExtra("theValue2Extra",theValue2); myIntent.putExtra("theOperatorValueExtra",theOperatorValue); startActivity(myIntent); } }