在Android的TextView中显示表情符号/情感图标 [英] Display emoji/emotion icon in Android TextView

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

问题描述

我有一些问题,在Android中的TextView

I have some problem with displaying emoji icon in Android TextView

首先,我发现绘文字图标在UNI code列表在这里: <一href="http://www.easyapns.com/category/just-for-fun">http://www.easyapns.com/category/just-for-fun

First, I found a list of emoji icon in unicode at here: http://www.easyapns.com/category/just-for-fun

二,我发现怎么在这里显示绘文字图标: <一href="https://github.com/sharakova/EmojiTextView/blob/master/src/jp/sharakova/android/emoji/EmojiTextView.java">https://github.com/sharakova/EmojiTextView/blob/master/src/jp/sharakova/android/emoji/EmojiTextView.java

Second, I found how to display emoji icon at here: https://github.com/sharakova/EmojiTextView/blob/master/src/jp/sharakova/android/emoji/EmojiTextView.java

该EmojiTextView.java可以将自动pdefined字符表情符号图标$ P $。所以,我想替换字符串一些predefined字符表情符号图标的所有事件,并把结果EmojiTextView.java 问题是我的code无法识别其中包含表情符号图标字符串表情符号图标。

The EmojiTextView.java can convert the predefined character to emoji icon automatically. Therefore, I want to replace all the occurrences of emoji icon in a String to some predefined character, and put the result to EmojiTextView.java The problem is my code cannot recognize emoji icon in the String which contains emoji icon.

下面是我的code段 - 我想找出如果输入匹配表情符号图标中的任何单code:

Here is my code snippet - I am trying to find if the input match any unicode of emoji icon:

// Array list of all emoji icon
private static final String[] ArrayEUnicodeString ={
    "\uE415",
    "\uE056",
    "\uE057",
    ...
}

// Nothing matched when it receive emoji icon with unicode "\uE415" from iphone. 'input' is message received from XMPP server
for (int i=0; i < emojiLength; i++)
{

    if (input.getBytes() == ArrayEUnicodeString[i].getBytes())
        Log.e("test", "ArrayEUnicodeString found");
}
// Note: iphone can display the emoji icon if I send "\uE415"

我不擅长单code比较/约定。有人可以帮我请,谢谢!

I am not good at unicode comparison/convention. Can somebody help me please, thanks!

推荐答案

这篇关于在Android的TextView中显示表情符号/情感图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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