I have a simple calculator that has six EditText views where users will enter numbers to perform a simple math function. This app will satisfy a repetitive task wherein the user
No, you have to implement it yourself. I suggest you create an int array with the IDs of all your EditTexts
you want to reset (R.id.xyz
). Then create a loop to .setText()
to each of the EditTexts from the array, which you can call every time you want the fields to be cleared. Something like:
private void resetFields() {
EditText temp;
for (int i = 0; i < myEditTexts.length; i++) {
temp = (EditText) findViewById(textViews[i]);
temp.setText("");
}
}