0

In my app i would like to forbid the use of virtual keyboards since want to avoid the user being able to insert emojis via the keyboard. I managed to remove the emoji button from the default keyboard by setting the EditText inputType properties to android:inputType="textVisiblePassword|text", based on this answer/ question. But given the case that the user uses a different virtual keyboard, the emoji button is back again of course.

Question: Is there a way to forbid virtual keyboards inside the app? So that only the default keyboard can be used.

And if not: How can i make the EditText field not accept any emojis from the user keyboard?

Thanks for your help!

  • 1
    Apparently the easiest way to disable emoji input is to set `android:inputType="textEmailAddress"` from [this thread.](https://stackoverflow.com/questions/22990870/how-to-disable-emoji-from-being-entered-in-android-edittext) – soupjake Nov 28 '18 at 13:44
  • Yes, i tried that - but when i for example have the Virtual Swift Keyboard installed, it uses it's own custom keyboard layout and the emoji button is there, no matter how i configure the input type. Therefore my question if it is possible to restrict the virtual keyboard to the default keyboard. – BetterSaveThanSorry Nov 28 '18 at 15:00
  • Even though the emoji button is there, are you actually able to enter in emojis into the field with that input type set? – soupjake Nov 28 '18 at 15:01
  • yes, unfortunately. But your answer helped me, i am using this dependency now to disable emojis from the keyboard: https://github.com/woxingxiao/XEditText – BetterSaveThanSorry Nov 28 '18 at 15:46
  • This thread can be closed, thank you! – BetterSaveThanSorry Nov 28 '18 at 15:47

0 Answers0