开发者

How to convert special character to Image(Smiley) [duplicate]

This question already has an answer here: Closed 11 years ago.

Possible Duplicate:

webserivce messages in listview with smileys

I created a Db and added 4 fields to it. 1. ID , 2. Position, 3. Special Character 4. URL. So I was able to display the corresponding special character when clicked. when I submit how can I convert that special character into smiley image. I tried to use functions like "Contains()" and "Replace". But nothing worked when I submitted the message to list view.

I am listing messages in list view from web service.

I get the开发者_开发百科 same special character and text. I don get the image instead of special character.

How can I convert special character into smiley image. I store all the images in drawable folder.


First Thing :Using ListAdapter you can achieve this Refer : http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/List14.html

And Second : You need to programatically decide which icon to replay with which special character.

In List Adapter you will have textview + icon.


Another method would be to use the webview. And create a html string and replace your special characters with image tags.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜