【发布时间】:2016-02-05 11:19:29
【问题描述】:
我们收到这样的回复:
[
{
id: 124,
membershipid: ,
title: MEMBER
},
{
id: 125,
membershipid: 4123,
title: TWOYEARDIRECTORR
},
{
id: 126,
membershipid: ,
title: TWOYEARDIRECTOR
},
{
id: 127,
membershipid: ,
title: MEMBER
}
]
我们正在尝试将 JsonString 转换为 JsonArray 我们的代码
ServiceHandler 是扩展HttpClient 的用户定义类
String jsonStr = sh.makeServiceCall(url_check, ServiceHandler.GET);
Log.d("result : ", jsonStr);
try {
JSONObject tt=new JSONObject(jsonStr);
}
但它显示org.json.JSON.typeMismatch
谁能帮帮我 提前致谢!
【问题讨论】:
-
[{id:124,membershipid:,title:MEMBER}..]不是有效的 json ...[{"id":124,"membershipid":"","title":"MEMBER"}..]是 -
@Pavan Alapati 你可以随时查看pro.jsonlint.com
-
使用 jsonlint 或任何其他资源检查您的 json 是否有效。
-
在 jsonlint 中显示有效的 json
-
发布完整的 logcat 错误。
标签: android json exception getjson type-mismatch