I am trying to store my EditTexts in an array and display all of them in a TextView, then have a sum function to get the sum of the array and display the sum. But I am stuck at this point.
public void Clickme (View view) {
public void clickMe (View v){
//my EditText’s ID is called myInput
EditText myInput = (EditText) findViewById(R.id.myInput);
//my TextView’s ID is called text2
TextView text2 = (TextView) findViewById(R.id.text2);
String str = myInput.getText().toString();
text2.setText(str);
int [] array = new int [myInput.length()];
//I am stuck at this point
for(int i=0; i <myInput.length(); i++) {
array[i] = Integer.valueOf(myInput.getText(i));
}
//sum function
for (int i: array) {
str = str + i;
EditText.setText(str);
}
}