Value of type java.lang.String cannot be converted to JSONArray

后端 未结 4 1094
情深已故
情深已故 2020-12-02 02:55

I\'ve spent 2 days to find a solution with of problem.

Here is the error:

E/log_tag: Error parsing data org.json.JSONException: Value of type java.l         


        
4条回答
  •  [愿得一人]
    2020-12-02 03:44

    In my case I was not decoding the jSon string before parsing it as jSon object. The following worked for me.

    JSONObject responseJSonObj = new JSONObject( URLDecoder.decode( result, "UTF-8" ) );
    

    Where result contains the jSon string to be parsed.

提交回复
热议问题