I'm getting below String:
[{"name":"abc", "roll": "123"}]
By the below code line:
response.body().string()
How can we convert it to JSON array that I can loop through each object and can access each property?
If I put that string to any variable like below;
String res = response.body().string();
It shows below FATAL EXCEPTION:
FATAL EXCEPTION: OkHttp Dispatcher
If it would okay then I would go with below lines:
JSONArray jarr = new JSONArray(res);
Log.e("DAILY", "" + jarr.length());
Any hints, what is going on?
Thanks!