title: How Do I Limit The Number of Characters Entered in an Alert Dialog EditText
body: <p>I know how to limit the size through XML (android:maxLength), but I am dynamically creating an alert dialog in code. Is there something similar I can use? (Prefer to have API 10 compatible solution as well)</p>
  
  <p>I am using the alert dialog to prompt the user for a text value to be shown graphically later.</p>
  
  <pre><code>public void onClickPosition(View v) {
      AlertDialog.Builder alert = new AlertDialog.Builder(this);
      alert.setTitle(R.string.title_Position);
      alert.setMessage(R.string.message_Position);
  
      final EditText input = new EditText(this);
      input.setText(_currentClass.getPosition());
      alert.setView(input);
  
      alert.setPositiveButton(R.string.option_Okay, new DialogInterface.OnClickListener() {
      public void onClick(DialogInterface dialog, int whichButton) {
          _currentClass.setPosition(input.getText().toString());
          TextView textView = (TextView)findViewById(R.id.textPosition);
          textView.setText(_currentClass.getPosition());
        }
      });
  </code></pre>