android - how set emoji by unicode in a textview? -


hi i'd following:

??? unicode = u+1f60a string emoji = getemijobyunicode(unicode) string text = "so happy " textview.settext(text + emoji); 

to in textview:

so happy 😊

how implement 'getemijobyunicode(unicode)'?

what should type of 'unicode'? (string/ char/ int??!)

please note not want use drawables!

found solution:

in unicode replaced 'u+' '0x'

example: replace 'u+1f60a' '0x1f60a'

this way got 'int' like

int unicode = 0x1f60a; 

which can used with

public string getemojibyunicode(int unicode){     return new string(character.tochars(unicode)); } 

so textview displays 😊 without drawable

try http://apps.timwhitlock.info/emoji/tables/unicode


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -