title: Set text on TextView onTextChanged
body: <p>I have a text view defined as class attribute so that I can access it in the entire class. In onCreate method I do the following:</p>
  
  <pre><code>chars = (TextView) findViewById(R.id.chars);
  chars.setText("300");
  </code></pre>
  
  <p>Later...:</p>
  
  <pre><code>public void onTextChanged(CharSequence s, int start, int before,
          int count) {
  
      int max = Integer.parseInt((String)chars.getText());
      int current = (message.getText().toString()).length();
  
      chars.setText(max-current);
  }
  </code></pre>
  
  <p>Well, actually I just retrieve the 300 as string, convert it to integer format and calculate the difference between max and current text length.Then I want to set this value as text on the text view. But this fails</p>
  
  <pre><code>12-29 20:37:06.155: E/AndroidRuntime(2165): FATAL EXCEPTION: main
  12-29 20:37:06.155: E/AndroidRuntime(2165): android.content.res.Resources$NotFoundException: String resource ID #0x12b
  12-29 20:37:06.155: E/AndroidRuntime(2165):     at android.content.res.Resources.getText(Resources.java:201)
  12-29 20:37:06.155: E/AndroidRuntime(2165):     at android.widget.TextView.setText(TextView.java:2857)
  12-29 20:37:06.155: E/AndroidRuntime(2165):     at com.markupartist.android.actionbar.example.ComposeActivity$3.onTextChanged(ComposeActivity.java:86)
  12-29 20:37:06.155: E/AndroidRuntime(2165):     at android.widget.TextView.sendOnTextChanged(TextView.java:6295)
  12-29 20:37:06.155: E/AndroidRuntime(2165):     at android.widget.TextView.handleTextChanged(TextView.java:6336)
  12-29 20:37:06.155: E/AndroidRuntime(2165):     at android.widget.TextView$ChangeWatcher.onTextChanged(TextView.java:6485)
  12-29 20:37:06.155: E/AndroidRuntime(2165):     at android.text.SpannableStringBuilder.sendTextChange(SpannableStringBuilder.java:889)
  12-29 20:37:06.155: E/AndroidRuntime(2165):     at android.text.SpannableStringBuilder.change(SpannableStringBuilder.java:352)
  12-29 20:37:06.155: E/AndroidRuntime(2165):     at android.text.SpannableStringBuilder.change(SpannableStringBuilder.java:269)
  12-29 20:37:06.155: E/AndroidRuntime(2165):     at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:432)
  12-29 20:37:06.155: E/AndroidRuntime(2165):     at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:409)
  12-29 20:37:06.155: E/AndroidRuntime(2165):     at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:28)
  12-29 20:37:06.155: E/AndroidRuntime(2165):     at android.view.inputmethod.BaseInputConnection.replaceText(BaseInputConnection.java:654)
  12-29 20:37:06.155: E/AndroidRuntime(2165):     at android.view.inputmethod.BaseInputConnection.setComposingText(BaseInputConnection.java:415)
  12-29 20:37:06.155: E/AndroidRuntime(2165):     at com.android.internal.view.IInputConnectionWrapper.executeMessage(IInputConnectionWrapper.java:318)
  12-29 20:37:06.155: E/AndroidRuntime(2165):     at com.android.internal.view.IInputConnectionWrapper$MyHandler.handleMessage(IInputConnectionWrapper.java:75)
  12-29 20:37:06.155: E/AndroidRuntime(2165):     at android.os.Handler.dispatchMessage(Handler.java:99)
  12-29 20:37:06.155: E/AndroidRuntime(2165):     at android.os.Looper.loop(Looper.java:123)
  12-29 20:37:06.155: E/AndroidRuntime(2165):     at android.app.ActivityThread.main(ActivityThread.java:3683)
  12-29 20:37:06.155: E/AndroidRuntime(2165):     at java.lang.reflect.Method.invokeNative(Native Method)
  12-29 20:37:06.155: E/AndroidRuntime(2165):     at java.lang.reflect.Method.invoke(Method.java:507)
  12-29 20:37:06.155: E/AndroidRuntime(2165):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
  12-29 20:37:06.155: E/AndroidRuntime(2165):     at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>Any ideas whats wrong?</p>