Android表情符号字符大小 [英] Android emojis char size

查看:440
本文介绍了Android表情符号字符大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在为Android开发键盘,我发现有些表情符号需要2个字符,有些表情符号需要1个字符,

I'm currently developing a keyboard for android , and i found out some emojis take 2 chars and some take 1 char ,

有没有一种方法可以区分

Is there a way to differ between the two if they are in a string ?

推荐答案

好,我设法通过使用这个lib来解决了这个问题

Ok i managed to solve this issue by using this lib

https://github.com/vdurmont/emoji-java

那里是一个isEmoji(string)

in there , there is a isEmoji(string)

   String currentTextStr = currentText.toString().substring(currentText.length() - 2);
   Log.e("emojicon",""+EmojiManager.isEmoji(currentTextStr));

这篇关于Android表情符号字符大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆