Skip to content Skip to sidebar Skip to footer

Jsonobject Cannot Be Converted To Jsonarray

My Android application is expecting and array of usernames from my WCF Service using the following Java, to then populate a spinner. JSONArray mtUsers = new JSONArray(new String(bu

Solution 1:

actually you are getting jsonObject, the value of the first key "GetUserNamesResult" is JSONArray.

so do this..

JSONObject jsonResponse = newJSONObject(newString(buffer));
JSONArray mtUsers = jsonResponse.getJSONArray("GetUserNamesResult");

Post a Comment for "Jsonobject Cannot Be Converted To Jsonarray"