Json Parsing To Listview/arrayadapter
I am making an app that parses JSON data to a listview. This is not working for me; it is not giving me any data back. This is my code : public class MainActivity extends AppCompa
Solution 1:
The problem is here JSONArray arr = new JSONArray(dbResult);
Change it to JSONObject arr = new JSONObject(dbResult);
seems that you have not posted the complete json data. If it doesn't solve please post complete json data
.
Solution 2:
You're getting a JSONObject from db, not an array, the array is inside this object. You should map the response from web service to JSONObject and the map the bestelling
field to JSONArray. And.. as was mentioned in the comment use some lib to help you with that, like GSON.
Post a Comment for "Json Parsing To Listview/arrayadapter"