title: Android: Characters left countdown in EditText
body: <p>I have this EditText with a limit of 150 characters: </p>
  
  <pre><code> &lt;EditText
      android:id="@+id/editText1"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:background="#fff"
      android:layout_marginBottom="50dp"
      android:padding="30dp"
      android:layout_alignParentLeft="true"
      android:layout_alignParentTop="true"
      android:maxLength="150"
      android:gravity="top|left"
      android:lineSpacingMultiplier="1.8"
      android:inputType="textMultiLine|textCapSentences" &gt;
  &lt;/EditText&gt;
  </code></pre>
  
  <p>TextView:</p>
  
  <pre><code>&lt;TextView
      android:id="@+id/textView1"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_marginLeft="100dp"
   /&gt;
  </code></pre>
  
  <p>NewActivity:</p>
  
  <pre><code>import android.app.Activity;
  import android.content.Intent;
  import android.os.Bundle;
  import android.text.Editable;
  import android.text.TextWatcher;
  import android.view.View;
  import android.view.View.OnClickListener;
  import android.view.animation.Animation;
  import android.view.animation.AnimationUtils;
  import android.widget.EditText;
  import android.widget.ImageButton;
  import android.widget.TextView;
  
  
  public class NewActivity extends Activity {
  
  
  
  
  private TextView textView1;
  private EditText editText1;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.new_text);
  
  
      final ImageButton a = (ImageButton) findViewById(R.id.imageBack);
      a.setOnClickListener(new OnClickListener()  {
  
          @Override
          public void onClick(View arg0) {
              Animation anim =              AnimationUtils.loadAnimation(NewActivity.this, R.anim.animation);
              a.startAnimation(anim);
  
              Intent intent = new Intent(NewActivity.this,MainActivity.class);
              startActivity(intent);
  
              editText1.addTextChangedListener(new TextWatcher()
              {
                  @Override
                  public void onTextChanged(CharSequence s, int start, int before, int count)
                  {
                  }
  
                  @Override
                  public void beforeTextChanged(CharSequence s, int start, int count, int aft)                                                                           
                  {
                  }
  
                  @Override
                  public void afterTextChanged(Editable s)
                  {
                     // this will show characters remaining
                      textView1.setText(150 - s.toString().length() + "/150");
                  }
              });
  
  
          }
      });
  
  
  
  
  }}
  </code></pre>
  
  <p>I want to create a small box in the top right corner of the page where you can see how many characters there is left, for example 132/150, i have tried looking at others solutions here on stackoverflow but i couldnt get them to work.</p>