在Android中解析JSON响应“无法将org.json.JSONObject类型的响应转换为JSONArray”

Potney Switters

我已经看到周围有很多问题,但是我想我缺少一个我找不到的细节。

我作为响应得到的字符串包含在以下错误中:

12-28 10:25:14.402: W/System.err(2133): org.json.JSONException: Value
{"status":"ok","userTier":"developer","total":1722082,"startIndex":1,"pageSize":5,"currentPage":1,"pages":344417,"orderBy":"newest",
"results":[{"webTitle":"AirAsia flight loses contact with air traffic control between Indonesia and Singapore","webPublicationDate":"2014-12-28T09:06:55Z","sectionName":"World news","sectionId":"world","id":"world\/live\/2014\/dec\/28\/airasia-flight-loses-contact-with-air-traffic-control-on-route-from-indonesia-to-singapore","webUrl":"
...  at response of type org.json.JSONObject cannot be converted to JSONArray

我的代码是

JSONObject jObject = new JSONObject(result);// result is the sting response presented above
JSONArray jArray = jObject.getJSONArray("response");
吉奥

response关键是JSONObject,您需要使用getJSONObject当前方法代替。

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

org.json.JSONObject 类型的响应无法转换为 JSONArray

来自分类Dev

Android JSON解析“无法将org.json.JSONObject类型的数据转换为JSONArray”错误

来自分类Dev

类型 org.json.JSONObject 无法转换为 JSONArray Android

来自分类Dev

将json响应转换为列表

来自分类Dev

将AppleScript响应转换为JSON

来自分类Dev

将JSON响应转换为DataTable

来自分类Dev

将 json 响应转换为表

来自分类Dev

错误:类型 org.json.JSONArray 无法转换为 JSONObject

来自分类Dev

org.json.JSONObject 类型无法转换为 JSONArray

来自分类Dev

解析 JSON - JSONObject 类型的 null 无法转换为 JSONArray

来自分类Dev

android json解析错误-无法将JSONArray转换为JSONObject

来自分类Dev

org.json.JSONException:无法将 org.json.JSONArray 类型的值 [{}] 转换为 JSONObject

来自分类Dev

org.json.JSONException中的错误:org.json.JSONArray类型无法转换为JSONObject

来自分类Dev

Ajax JSON响应转换为HighCharts

来自分类Dev

org.json.JSONException:org.json.JSONArray类型的值[....]无法转换为JSONObject

来自分类Dev

android org.json.JSONArray无法转换为JSONObject吗?

来自分类Dev

android org.json.JSONArray无法转换为JSONObject吗?

来自分类Dev

将奇怪的JSON响应转换为简单对象的数组

来自分类Dev

将JSON响应转换为Graph.EducationAssignment对象

来自分类Dev

如何将Powershell JSON响应转换为CSV

来自分类Dev

如何将JSON响应转换为PHP数组

来自分类Dev

将JSON响应转换为(Bootstrap)表

来自分类Dev

Java将json rest api响应转换为图像

来自分类Dev

将 json 响应转换为 C# 变量

来自分类Dev

将 JSON 响应转换为 python 对象

来自分类Dev

Json解析gorg.json.JSONObject无法转换为JSONArray

来自分类Dev

类型为org.json.JSONArray的0处无法转换为JSONObject

来自分类Dev

org.json.JSONArray 类型的项目无法转换为 JSONObject

来自分类Dev

无法在Android中解析复杂的JSON响应

Related 相关文章

  1. 1

    org.json.JSONObject 类型的响应无法转换为 JSONArray

  2. 2

    Android JSON解析“无法将org.json.JSONObject类型的数据转换为JSONArray”错误

  3. 3

    类型 org.json.JSONObject 无法转换为 JSONArray Android

  4. 4

    将json响应转换为列表

  5. 5

    将AppleScript响应转换为JSON

  6. 6

    将JSON响应转换为DataTable

  7. 7

    将 json 响应转换为表

  8. 8

    错误:类型 org.json.JSONArray 无法转换为 JSONObject

  9. 9

    org.json.JSONObject 类型无法转换为 JSONArray

  10. 10

    解析 JSON - JSONObject 类型的 null 无法转换为 JSONArray

  11. 11

    android json解析错误-无法将JSONArray转换为JSONObject

  12. 12

    org.json.JSONException:无法将 org.json.JSONArray 类型的值 [{}] 转换为 JSONObject

  13. 13

    org.json.JSONException中的错误:org.json.JSONArray类型无法转换为JSONObject

  14. 14

    Ajax JSON响应转换为HighCharts

  15. 15

    org.json.JSONException:org.json.JSONArray类型的值[....]无法转换为JSONObject

  16. 16

    android org.json.JSONArray无法转换为JSONObject吗?

  17. 17

    android org.json.JSONArray无法转换为JSONObject吗?

  18. 18

    将奇怪的JSON响应转换为简单对象的数组

  19. 19

    将JSON响应转换为Graph.EducationAssignment对象

  20. 20

    如何将Powershell JSON响应转换为CSV

  21. 21

    如何将JSON响应转换为PHP数组

  22. 22

    将JSON响应转换为(Bootstrap)表

  23. 23

    Java将json rest api响应转换为图像

  24. 24

    将 json 响应转换为 C# 变量

  25. 25

    将 JSON 响应转换为 python 对象

  26. 26

    Json解析gorg.json.JSONObject无法转换为JSONArray

  27. 27

    类型为org.json.JSONArray的0处无法转换为JSONObject

  28. 28

    org.json.JSONArray 类型的项目无法转换为 JSONObject

  29. 29

    无法在Android中解析复杂的JSON响应

热门标签

归档