要在软键盘中显示表情符号按钮,我在EditText:
中使用它android:inputType="textShortMessage"
使用我的设备的表情符号图标(可能特定于我的运营商/手机型号)。
我想用自己的一套drawable来代替。有没有办法做到这一点,而无需创建一个全新的软键盘?
答案 0 :(得分:1)
不,没有任何单行解决方案,也许Lollipop有一个,因为它附带了表情符号。
选项:
答案 1 :(得分:0)
我可以使用here中的EmojiHandler来解决这个问题:
从文本消息内容中获取表情符号的unicode:
String s = EmojiHandler.decodeJava(content);
// use decoded string to display emoji in TextView, Button, etc
textButton.setText(s);
要从软键盘对表情符号进行编码并将其放入字符串:
String encodedEmoji = EmojiHandler.encodeJava(msgText);