How to set emoji by unicode in a textview? | Newbedev
文章推薦指數: 80 %
So Textview displays without Drawable. Try it with http://apps.timwhitlock.info/emoji/tables/unicode. You can directly use Emojis in string resources by ...
MenuNEWBEDEVPythonJavascriptLinuxCheatsheetContactNEWBEDEVHowtosetemojibyunicodeinatextview?Foundasolution:
InmyunicodeIreplaced'U+'by'0x'
Example:replace'U+1F60A'by'0x1F60A'
ThiswayIgotan'int'like
intunicode=0x1F60A;
Whichcanbeusedwith
publicStringgetEmojiByUnicode(intunicode){
returnnewString(Character.toChars(unicode));
}
SoTextviewdisplayswithoutDrawable
Tryitwithhttp://apps.timwhitlock.info/emoji/tables/unicode
YoucandirectlyuseEmojisinstringresourcesbyusingthedecimalcodelikethis:
😊
forexample:
延伸文章資訊
- 1How to access and use emoji on Android
- 2How to set emoji by unicode in a textview? - Stack Overflow
How to set emoji by unicode in a textview? android unicode textview encode emoji. Hi I'd like to ...
- 3Display emoji/emotion icon in Android TextView | Newbedev
Why do you want to embed the protected Apple emoji images in your application at all? The Unicode...
- 4Emoji Compatibility | Android Developers
It also updates the necessary emoji metadata that the EmojiCompat support library needs to keep u...
- 5How to set emoji by unicode in a textview? - py4u
??? unicode = U+1F60A String emoji = getEmojiByUnicode(unicode) String text = "So ...