How to disable emojis programmatically in Android

后端 未结 7 1060
走了就别回头了
走了就别回头了 2020-12-06 02:11

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

7条回答
  •  庸人自扰
    2020-12-06 02:43

    It's probably not the best solution but the code below worked for me just fine:

    editText.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD);
    

    and since the password input type changes the font you just set the default typeface to it:

    editText.setTypeface(Typeface.DEFAULT);
    

提交回复
热议问题