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
Comments
Post a Comment