Reputation: 1067
To display the emoji button in the soft keyboard I use this in the EditText:
android:inputType="textShortMessage"
which uses the emoji icons for my device (which may be specific to my carrier/phone model).
I want to use my own set of drawables instead. Is there a way to do this without having to create a completely new soft keyboard?
Upvotes: 1
Views: 1168
Reputation: 1067
I was able to solve this by using the EmojiHandler from here:
To get the unicode of the emoji from textual message content:
String s = EmojiHandler.decodeJava(content);
// use decoded string to display emoji in TextView, Button, etc
textButton.setText(s);
To encode the emoji from the softkeyboard and put it into a String:
String encodedEmoji = EmojiHandler.encodeJava(msgText);
Upvotes: 0
Reputation: 6530
No, there isn't any single line solution, maybe there is one at Lollipop as it is shipped with emoticons.
Options:
Upvotes: 1