在列表视图与笑脸webserivce消息 [英] webserivce messages in listview with smileys

查看:183
本文介绍了在列表视图与笑脸webserivce消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的工作与表情符号聊天应用程序。我有一个图像按钮,显示表情图标网格视图弹出点击时。我可以选择任何的笑脸,它会得到显示在编辑文本。

我的问题是:现在我已经在我的EditText笑脸图片和文字。当我点击发送,我需要用笑脸在列表视图中显示此消息。是否有可能显示在列表视图在那里我得到mesages从web服务的文字图片。

列表视图用在这里作为一个地方显示来自Web服务消息。如何进一步在这方面,我的工作。

请指导我这个问题。

问候, 拉哈夫拉贾戈帕兰

解决方案
  

是否有可能在列表视图在那里我得到mesages从web服务的文本显示图像。

  • 是的,它是可能的,当然。如果您使用的是一些复杂的方式来从Web服务到适配器的信息,你必须将这个与发送这些到该适配器。
  

是否可以将图像发送到web服务并获取他们回来在我的列表视图。我使用的.NET Web服务。我回从Web服务的XML作为我的反应。

  • 不要那样做。把你的表情的绘制或下载一次他们。使用您自己的标签中的文字表情符号。例如,当字符串:)发生把一个笑脸。
  

我创建了一个数据库,并添加4个领域吧:ID,位置,特殊字符,URL。所以我能够在单击时,显示相应的specialcharcter。当我提交我如何将其转换成specialcharcter笑脸图像。我试图使用功能,如包含()和替换。但是,没有什么工作时,我submited的消息列表视图。我得到同样的specialcharcter和文字。我不想让specialcharcter的形象代替。请指引我

  • 我想你插入的消息一个TextView里面。你可以用与替换特殊字符的occurances< IMG SRC = \源\/>中
  • 使用它来获取所示的图像的setText(Html.fromHtml(你怎么样< IMG SRC = \yourimage.png \/>中));
  • 要替换:)< IMG SRC = \yourimage.png \/> 。 。使用 yourString.replaceAll(:),< IMG SRC = \yourimage.png \/>中);

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 get displayed in Edit Text.

My problem is : Now i have smiley image and text in my edittext. when i click on send i need to display this message with smiley in listview. Is it possible to display images with text in listview where i get mesages from webservice.

List view is used here as a place to display messages from web service. How can i work further in this.

Please guide me in this issue.

Regards, Raghav Rajagopalan

解决方案

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 "<img src=\"the source\" />"
  • Use this to get the image shown setText(Html.fromHtml("hi how are you <img src=\"yourimage.png\" />"));
  • To replace :) with <img src=\"yourimage.png\" />.. use yourString.replaceAll(":)","<img src=\"yourimage.png\" />");

这篇关于在列表视图与笑脸webserivce消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆