I want to disable some of buttons in typed area. for example I want to disable 1,2,3 buttons in keyboard. I want to learn is it possible or not?

I want to disable some of buttons in typed area. for example I want to disable 1,2,3 buttons in keyboard. I want to learn is it possible or not?

 
    
     
    
    You can use following code in your xml
<EditText 
  android:inputType="text" 
  android:digits="0,4,5,6,7,8,9
/>
 
    
    You can use following code either on java side
private List<Char> allowedChars = new ArrayList(Char);
allowedChars.add(...);
allowedChars.add(...);
allowedChars.add(...);
allowedChars.add(...);
InputFilter filter = new InputFilter() { 
        public CharSequence filter(CharSequence source, int start, int end, 
Spanned dest, int dstart, int dend) { 
                for (int i = start; i < end; i++) { 
                        // Your condition here 
                        if (!allowedChars.contains(source.charAt(i)))) { 
                                return ""; 
                        } 
                } 
                return null; 
        } 
}; 
edit.setFilters(new InputFilter[]{filter});
