How to set emoji by unicode in a textview?
You can directly use Emojis in string resources by using the decimal code like this:
😊
for example:
<string name="emoji">I am happy 😊</>
Found a solution:
In my unicode I replaced 'U+' by '0x'
Example: replace 'U+1F60A' by '0x1F60A'
This way I got an 'int' like
int unicode = 0x1F60A;
Which can be used with
public String getEmojiByUnicode(int unicode){
return new String(Character.toChars(unicode));
}
So Textview displays ð without Drawable
Try it with http://apps.timwhitlock.info/emoji/tables/unicode