title: setText after TextWatcher on a programatically created EditText
body: <p>Have have an app where I programatically create LinearLayouts. The LinearLayouts differ a little bit, but they all contain several views. Some of them have a EditText-field with a TextWatcher. When these views are created, I want to use an old, stored value from preferences  in the EditText-field. </p>
  
  <p>When I use .setText(old_value) before the TextWtacher, the data in the EditText-field is correct, but the calulations denpending on the TextWatcher-function is never invoked. 
  When I try to use .setText(old_value) after the TextWtacher, I get a NullPointerException.</p>
  
  <p>Below are a short example of code...</p>
  
  <pre><code>(LinearLayout) linearLayout = new LinearLayout();
  linearLayout.setId(ll_counter++);
  while (have more rows to process) {
      BUTTON-VIEW-code;
      linearLayout.addView();
      TEXT-VIEW-code
      linearLayout.addView(TEXT-VIEW);
  
      editText = new EditText(this);
      editText.setId(et_counter++);
      editText.setTag("SomeTag");
      editText.setText(old_value); // Works, but no calculations
      editText.addTextChangedListener(new TextWatcher() {
          public void afterTextChanged(Editable s) {
              // do calculations and update add_text-field.
          }
          public void beforeTextChanged(Editable s) {
              // nothing here
          }
          public void onTextChanged(Editable s) {
              // nothing here
          }
  
      });
      editText.setText(old_value); // Doesn't Works, NULL PONTER EXCEPTION
      linearLayout.addView(editText);
  }
  </code></pre>
  
  <p>Should the editText.setText come after linearLayout.addView(editText); like this? (With some modifcations of course...)</p>
  
  <pre><code>linearLayout.addView(editText);
  editText.setText(old_value);
  </code></pre>