The problem is your code:
final double tf1 = Double.parseDouble(String.valueOf(R.id.editText1)); final double tf2 = Double.parseDouble(String.valueOf(R.id.editText2));
you do not accept the value of EditText, but instead refer to objects. You should change this for something like this
final double tf1 = Double.parseDouble(((EditText)findViewById(R.id.editText1)).getText().toString()); final double tf2 = Double.parseDouble(((EditText)findViewById(R.id.editText2)).getText().toString());
In addition, you must include these lines in the OnClick method of the button, so it will take the current values ββwhen you click the button.
source share