我有问题。我有一个String结果。这个结果看起来像JsonArray但没有转换为JsonArray。我能怎么做?
这是我的字符串:
{
"PositionList": [{
"Id": "56fd111c7283763f941b8cbd",
"PlateNumber": "34GS1919",
"PositionRefNo": "00264",
"LoadingDate": "2016-03-31T14:59:58.967+03:00",
"DepartureCityName": "İSTANBUL",
"DepartureCountyName": "",
"ArrivalCityName": "İSTANBUL",
"ArrivalCountyName": "",
"LoadCount": 1
}],
"Status": true,
"Message": "",
"LoginUserInfo": {
"Id": "572856007507d911d04433f8",
"UserName": "surucu1",
"Name": "Sürücü",
"Surname": "1"
},
"LoginDriverInfo": {
"Id": "537d96fbf4531a24440e6eba",
"Name": "joe",
"Surname": "fun"
}
}
答案 0 :(得分:0)
答案 1 :(得分:0)
我认为它是json对象,你可以用这些代码解析它:
JSONObject jsonObject = new JSONObject("yourString");
之后
JSONArray jsonArray = jsonObject.getJSONArray("PositionList");
您可以将字符串复制并粘贴到此页面以进行检查:http://json.parser.online.fr/
答案 2 :(得分:0)
如果要在不使用GSON库的情况下进行解析,请执行以下操作
datetime