display built-in emoji keys for inputmethod

前端 未结 4 1624
梦毁少年i
梦毁少年i 2021-02-08 12:13

I\'m building a custom soft keyboard for android and would like to add a layout to include the emoji keys similar to what the default android keyboard (AOSP) is doing. I\'ve sea

4条回答
  •  长发绾君心
    2021-02-08 12:41

    Thanks for all the suggestions. What I got to work for showing an emoji layout in my custom keyboard was the following:

    1. In the .xml layout file, for each emoji you want to add, create a line like this:

    2. When committing the key, use: getCurrentInputConnection().commitText(String.valueOf(Character.toChars(primaryCode)), 1);

提交回复
热议问题