【发布时间】:2020-10-14 14:12:24
【问题描述】:
我需要向 Volley 和 kotlin 提出请求,我的 cod 是
val stringReq = StringRequest(
Request.Method.GET, url,
Response.Listener<String> { response ->
var strResp = response.toString()
val jsonObj: JSONObject = JSONObject(strResp)
val jsonArray: JSONArray = jsonObj.getJSONArray("curso")
for (i in 0 until jsonArray.length()) {
var jsonInner: JSONObject = jsonArray.getJSONObject(i)
listGeral.add(jsonInner.get("interpret").toString());
listGeral2.add(jsonInner.get("titel").toString());
listGeral3.add(jsonInner.get("id").toString());
}
},
Response.ErrorListener {
})
queue.add(stringReq)
现在我需要为 php 发送 3 个参数。发送参数的指令怎么写?
【问题讨论】:
-
这已经被问及回答了:stackoverflow.com/a/16639438/112263
-
这个响应在 JAVA 中,我需要在 Kotlin 中
标签: android kotlin android-volley