[Solved] How make addition of two or more numbers in a single EditText?

[ad_1]

How to get text from edittext?

initialize edittext:

EditText editText = findViewById(R.id.edittext);
String[] editTextValues = edittext.getText().toString().split(" ");

now use editTextValues like this

int firstValue =  Integer.parse(editTextValues[0]);
int secondValue = Integer.parse(editTextValues[1]);

int sum = firstValue + secondValue;

[ad_2]

solved How make addition of two or more numbers in a single EditText?