How to Get Text and Smiley from Edittext into String?

后端 未结 2 762
失恋的感觉
失恋的感觉 2021-02-06 14:06

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 Forma

2条回答
  •  孤独总比滥情好
    2021-02-06 14:36

    Use Html.toHtml(Spanned text)

    like:

    String myString = Html.toHtml(cs);
    System.out.println(myString);
    

    edit: iam digging in the dark here but could it be you want the text(string) representation of your Smillie?

    like you have:

    cs = Html.fromHtml(
                "", imageGetter, null);
    

    and you want:

    String cs = ":)";

    is that right? if not, my previous answer gives you the technical String representation of your Html code

提交回复
热议问题