title: android EditText maxLength allows user to type more
body: <p>I've already set the maxLength attribute for an EditText widget in the xml layout file, and it does limit the display of characters.</p>
  
  <p>But it still allows the user to press more letters on the keyboard, and backspacing deletes these extra presses rather than the last letter on the display.</p>
  
  <p>I believe this is not how it's supposed to be.  Pressing keys after the limit has been reached should stop accepting more input even if it is not displayed. </p>
  
  <p>Any fix on this?</p>
  
  <p><strong>Update</strong></p>
  
  <p>Based on the answer below, for multiline EditText, add the textMultiLine attribute too.</p>
  
  <pre><code>android:inputType="textFilter|textMultiLine"
  </code></pre>