JSONException: Value of type java.lang.String cannot be converted to JSONObject

前端 未结 14 2308
别那么骄傲
别那么骄傲 2020-11-22 07:10

I have a JSON file with 2 JSON-Arrays in it: One Array for routes and one Array for sights.

A route should consist of several sights where the user gets navigated to

14条回答
  •  野性不改
    2020-11-22 07:40

    This is simple way (thanks Gson)

    JsonParser parser = new JsonParser();
    String retVal = parser.parse(param).getAsString();
    

    https://gist.github.com/MustafaFerhan/25906d2be6ca109f61ce#file-evaluatejavascript-string-problem

提交回复
热议问题