title: How to update a textview while typing in an edittext in android
body: <p>I have multiple <code>edittext</code>and  a <code>textview</code> in the bottom in order to get the sum of what is written in the <code>edittexts</code>but I didn't succeded. I tried the <code>TextWatcher</code>but it doesn't do the work, for exemple i write in the first one 5 and in the second 10 I got 16 as a result as it counts 5+1+10. I also tried the <code>onfocus</code> method but the problem still with the last <code>edittext</code> it doesn't update the result. I really don't know what to do. Someone had this issue before?
  TextWatcher implementation:</p>
  
  <pre><code>TextWatcher inputTextWatcher1 = new TextWatcher() {
               public void afterTextChanged(Editable s) {
                  number = Integer.parseInt(s.toString());
                  sum+=number;
                  tv.setText("sum is "+sum);
  
  }
  
              @Override
              public void beforeTextChanged(CharSequence s, int start, int count,
                      int after) {
                  // TODO Auto-generated method stub
  
              }
  
              @Override
              public void onTextChanged(final CharSequence s, int start, int before,
                      int count) {
  
              }
  
          };
  </code></pre>