So I'm a beginner with Android studio and trying to make this simple application that calculates how much water you in total and on average drink. The idea is that someone types in everyday of a whole week how much water they drunk. When I hit "calculate it" calculates the total and average a day.

My problem is that whenever I put in a number with a decimal like 2,3 the app crashes. I did find a solution were I needed to make a validation (if, else) function, but I am not quite sure how to select all the days in one function.

```
public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        Button addBtn = (Button) findViewById(R.id.calculateBtn);
        addBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                EditText editTextMon = (EditText) findViewById(R.id.editTextMon);
                EditText editTextTue = (EditText) findViewById(R.id.editTextTue);
                EditText editTextWed = (EditText) findViewById(R.id.editTextWed);
                EditText editTextThu = (EditText) findViewById(R.id.editTextThu);
                EditText editTextFri = (EditText) findViewById(R.id.editTextFri);
                EditText editTextSat = (EditText) findViewById(R.id.editTextSat);
                EditText editTextSun = (EditText) findViewById(R.id.editTextSun);
                TextView resultTextView = (TextView) findViewById(R.id.resultTextView);
                TextView errorView = (TextView) findViewById(R.id.errorView);
                TextView averageTextView = (TextView) findViewById(R.id.averageTextView);
                EditText allDays = (EditText) findViewById(R.id.editTextMon); 

                int mon = Integer.parseInt(editTextMon.getText().toString());
                int tue = Integer.parseInt(editTextTue.getText().toString());
                int wed = Integer.parseInt(editTextWed.getText().toString());
                int thu = Integer.parseInt(editTextThu.getText().toString());
                int fri = Integer.parseInt(editTextFri.getText().toString());
                int sat = Integer.parseInt(editTextSat.getText().toString());
                int sun = Integer.parseInt(editTextSun.getText().toString());

                if ( ! (allDays.equals("") || allDays.equals("-")) ) {
                    int result = mon + tue + wed + thu + fri + sat + sun;
                    resultTextView.setText("Total: " + result + " L");

                    int average = result / 7;
                    averageTextView.setText("Avg: " + average + " L");
                } else {
                    errorView.setText("Invalid Input");
                }

            }
        });
    }
}

```