Restrict numbers from being entered on an EditText
<p>I need to restrict the user for entering Numbers (0-9) in an EditText and allow every other character from the keyboard.</p>

<p>The following code is not working on the following scenario.</p>

<p>If the user enters an alphabet and then a number, the editText becomes empty.</p>

<pre><code>InputFilter withoutNumberFilter = new InputFilter() {
    public CharSequence filter(CharSequence source, int start, int end,
            Spanned dest, int dstart, int dend) {
        for (int i = start; i &lt; end; i++) {
            if (Character.isDigit(source.charAt(i))) {
                return "";
            }
        }
        return null;
    }
};

editText.setFilters(new InputFilter[] { withoutNumberFilter });
</code></pre>