I want to hide emojis and auto suggestions from keyboard programmatically. Its working in some Android devices but not in all devices. here\'s my code for hide auto suggesti
Try this it's works for me
editText.setFilters(new InputFilter[]{new EmojiExcludeFilter()});
private class EmojiExcludeFilter implements InputFilter {
@Override
public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {
for (int i = start; i < end; i++) {
int type = Character.getType(source.charAt(i));
if (type == Character.SURROGATE || type == Character.OTHER_SYMBOL) {
return "";
}
}
return null;
}
}