简体   繁体   English

如何将SOAP Web服务响应数据绑定到Android中的SpinnerView?

[英]How to bind a SOAP web service response data to a SpinnerView in Android?

I need to display the names from SOAP web services, when I was singin my application next page spinner and some textviews. 当我在应用程序的下一个微调框和一些textview中唱歌时,我需要显示SOAP Web服务的名称。 I'm getting response about text fields. 我收到有关文本字段的回复。

But I need to know how to get data into the spinner? 但是我需要知道如何将数据输入微调器吗?

Basically you what you need to. 基本上就是您所需要的。

  • First you need to send a HTTP request to your server.And you better do via AsyncTask without interrupting your UI thread. 首先,您需要向服务器发送HTTP请求。最好通过AsyncTask进行操作而又不中断UI线程。

  • Secondly you need to parse the response from your request according to your needs.The response from web service can be either XML or JSON or something else. 其次,您需要根据需要解析请求的响应。Web服务的响应可以是XML或JSON或其他。

  • And the last one you need to write your custom adapter to populate your spinner and then set it as your spinner adapter. 最后一个您需要编写自定义适配器来填充微调器,然后将其设置为微调器适配器。

在异步任务中将其从Web服务获取到数组中,然后从中填充微调框。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM