What you are trying to do is so, so trivial, I don't know how you could've searched any length of time at all and not have found dozens, if not hundreds, of examples. Anyway...
In the
onClick()
handler for the "Calculate Grade" button, call the
getText()
method for each
EditText
widget to get its value, and then call
Double.parseDouble()
to convert that value and assign it to each of your
grade#
variables. For example:
EditText et = (EditText) findViewById(R.id.grade1);
grade1 = Double.parseDouble(et.getText().toString());
Since it is read only, you should consider change the "Percentage"
EditText
to be a
TextView
widget instead. Then you can assign the sum to it like:
TextView tv = (TextView) findViewById(R.id.pct);
tv.setText(String.valueOf(grade1 + ...));