我从 UI 得到了 json[]。我必须将其转换为 Json 对象,如何使用gson
. 接收到的对象是这样的:
[{"name":"name","value":"value"},{"name":"first","value":"100"},{"name":"hor","value":"95"},{"name":"conf","value":"95"}],[{"name":"vaRType","value":"INCRE"},{"name":"per","value":"100"},{"name":"hor","value":"95"},{"name":"conf","value":"95"}]
我用过JsonObject obj = new JsoParser().parse(jsonStrnig).getAsJsonObject();
,但它会引发异常。