【问题标题】:How to make three spinner that content (district,subdistrict head, urban village head)如何制作三个包含内容的微调器(区、街道负责人、城中村负责人)
【发布时间】:2016-12-30 20:27:15
【问题描述】:

如何使用 webservice JSON 制作三个内容(区、街道、城中村长...)的微调器?

如何在三个 spinner 中链接 query 和 webservice JSON?

三个 Spinner webservice JSON 查询的问题。

【问题讨论】:

  • 首先从 web 服务获取区域 json 并存储在第一个微调器中。单击微调器项目时,使用所选值调用 subdistrct api

标签: android json spinner


【解决方案1】:

在您的 xml 代码中添加三个微调器。将该 json response1 转换为 listview 并将其添加到 spinner1。选择 spinner1 时对 response2 进行服务调用。

Spinner spinner1 = (Spinner) findviewbyid(R.id.spinner1);
adapter = new ArrayAdapter<>(getApplicationContext(),
R.layout.spinner_layout, service_response_1);
spinner1.setAdapter(adapter);

这可能会对你有所帮助。

【讨论】:

    猜你喜欢
    • 2018-08-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-01-09
    • 1970-01-01
    • 2012-02-10
    • 1970-01-01
    相关资源
    最近更新 更多