I got stuck up with the following scenario.
I have an edit text and its a Password field. And I want to restrict some characters like (a-z, A-Z, 1-0 and some special chars). I set the inputType of this edittext as "textPassword" and used Numberkeylistner to restrict the characters. It works fine in Motorola xoom tablet.
But I am getting suggestions while entering the Password in ASUS tablet. The problem is when I comment the following set of lines then its working fine that means its not showing any suggestions to the password field.
NumberKeyListener PwdkeyListener = new NumberKeyListener() {
public int getInputType() {
return InputType.TYPE_MASK_VARIATION;
}
@Override
protected char[] getAcceptedChars() {
return new char[] { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '@', '.', '_', '#', '$', '%', '&', '*', '-', '+', '(', ')', '!', '"', '\'', ':',
';', '/', '?', ',', '~', '`', '|', '\\', '^', '<', '>', '{', '}', '[', ']', '=', '£', '¥', '€', '.', '¢', '•','©' };
}
};
edtObj.setKeyListener(PwdkeyListener);
But I am getting this issue in ASUS tablet only.
Can anyone tell me how to restrict character without using keylistener.
Thanks in advance.