webserivce messages in listview with smileys

前端 未结 1 941
既然无缘
既然无缘 2020-12-12 07:13

I am working on a chat application with smileys. I have a image button that shows a pop up of smileys in grid view when clicked. I can select any smiley in that and it will

1条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-12 07:49

    Is it possible to display images with text in listview where i get mesages from webservice.

    • Yes it is possible of course. If you are using some complex way to get the messages from the webservice into the adapter, you must integrate this with sending these to the adapter.

    Is it possible to send images to webservice and fetch them back in my listview. I am using .Net web service. I return XML from web service as my response.

    • Don not do that. Put your smileys in drawable or download them only once. Use your own tags inside text for smileys. For example when string :) occurs put a smiley.

    I created a Db and added 4 fields to it: ID , Position, Special Character, URL. So i was able to display the corresponding specialcharcter when clicked. When i submit how can i convert that specialcharcter into smiley image. I tried to use functions like "Contains()" and "Replace". But nothing worked when i submited the message to listview. I get the same specialcharcter and text. I don get the image instead of specialcharcter. Please guide me

    • I suppose you are inserting the message inside a textView. You can use to replace the occurances of the special character with ""
    • Use this to get the image shown setText(Html.fromHtml("hi how are you "));
    • To replace :) with .. use yourString.replaceAll(":)","");

    0 讨论(0)
提交回复
热议问题