title: TextWatcher for multiple EditText
body: <p>I want to be able to calculate something depending on the input in 2 of 3 <code>EditText</code>. For Example: I make an input in ET 1 and 2 -> i get a calculation in ET 3. ET 1 and 3 -> calculation in ET 2... and so on.</p>
  
  <p>I get it to work with 2 <code>EditText</code> but with 3 I get an StackOverFlowError. </p>
  
  <pre><code>private class GenericTextWatcher implements TextWatcher {
  
      private View view;
  
      private GenericTextWatcher(View view) {
          this.view = view;
      }
  
      public void beforeTextChanged(CharSequence charSequence, int i, int i1,
              int i2) {
      }
  
      public void onTextChanged(CharSequence charSequence, int i, int i1,
              int i2) {
      }
  
      public void afterTextChanged(Editable editable) {
          switch (view.getId()) {
          case R.id.liter_input:
              try {
                  if (amount_widget.getText().toString().equals(" ") == false
                          || literPrice_widget.getText().toString()
                                  .equals(" ") == false
                          || price_widget.getText().toString().equals(" ") == false) {
                      double editTextCalc = Double.parseDouble(amount_widget
                              .getText().toString())
                              * Double.parseDouble(literPrice_widget
                                      .getText().toString());
                      editTextCalc = Math.round(editTextCalc * 100) / 100.0;
                      price_widget.setText(String.valueOf(decimalFormat
                              .format(editTextCalc)));
                  }
  
              } catch (Exception e) {
                  // TODO: handle exception
              }
              break;
          case R.id.literprice_input:
              try {
                  if (amount_widget.getText().toString().equals(" ") == false
                          || literPrice_widget.getText().toString()
                                  .equals(" ") == false
                          || price_widget.getText().toString().equals(" ") == false) {
                      double editTextCalc = Double.parseDouble(amount_widget
                              .getText().toString())
                              * Double.parseDouble(literPrice_widget
                                      .getText().toString());
                      editTextCalc = Math.round(editTextCalc * 100) / 100.0;
                      price_widget.setText(String.valueOf(decimalFormat
                              .format(editTextCalc)));
                  }
  
              } catch (Exception e) {
                  // TODO: handle exception
              }
              break;
          case R.id.price_input:
              try {
                  if (amount_widget.getText().toString().equals(" ") == false
                          || literPrice_widget.getText().toString()
                                  .equals(" ") == false
                          || price_widget.getText().toString().equals(" ") == false) {
                      double editTextCalc = Double.parseDouble(amount_widget
                              .getText().toString())
                              / Double.parseDouble(price_widget.getText()
                                      .toString());
                      editTextCalc = Math.round(editTextCalc * 100) / 100.0;
                      literPrice_widget.setText(String.valueOf(decimalFormat
                              .format(editTextCalc)));
                  }
  
              } catch (Exception e) {
                  // TODO: handle exception
              }
              break;
          }
      }
  }
  </code></pre>