How to Get text and smiley from edittext into String?
Using Following Code I was Add Smiley/Emojis in Edittext but how to get text/smiley from edittext into String Format.
ImageGetter imageGetter = new ImageGetter() {
public Drawable getDrawable(String source) {
Drawable d = getResources().getDrawable(
R.drawable.happy);
d.setBounds(0, 0, d.getIntrinsicWidth(), d.getIntrinsicHeight());
return d;
}
};
cs = Html.fromHtml(
"<img src='"
+ getResources()
.getDrawable(R.drawable.happy)
+ "'/>", imageGetter, null);
edttxtemoji.setText(cs);
Please use following function.
following for emotions code...
and settext using
Use Html.toHtml(Spanned text)
like:
edit: iam digging in the dark here but could it be you want the text(string) representation of your Smillie?
like you have:
and you want:
String cs = ":)";
is that right? if not, my previous answer gives you the technical String representation of your Html code