Using a conditional maxLength in input filter in Android
<p>I am using input filter:</p>

<pre><code>int max_length;
max_length = 15;
InputFilter[] FilterArray = new InputFilter[1];
FilterArray[0] = new InputFilter.LengthFilter(max_length);

final EditText input = new EditText(getBaseContext());
input.setFilters(FilterArray);
alert_screen.setView(input);
</code></pre>

<p>It works, but I need to make max_length a conditional value. For example, if user inputs only digits, max_length will be equal to 15, but if user inputs some letter, max_length must be equal to 11.  </p>
