title: Android:: Set max-length of EditText programmatically with other InputFilter
body: <p>I'm using InputFilter like this to allow only alpha and numbers</p>
  
  <pre><code>private InputFilter[] inputFilters = new InputFilter[] { new InputFilter()
  {
      @Override
      public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend)
      {
          for (int i = start; i &lt; end; ++i)
          {
              if (!Pattern.compile("[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890]*").matcher(String.valueOf(source.charAt(i))).matches())
              {
                  return "";
              }
          }
  
          return null;
      }
  } };
  </code></pre>
  
  <p>But problem is "android:maxLength" value in xml file is not working with this InputFilter</p>
  
  <p>I think I need code in InputFilter to set max-length of EditText </p>
  
  <p>Anyone has good idea for this? </p>
  
  <p>Thanks </p>