Display json data to list view

前端 未结 1 1680
庸人自扰
庸人自扰 2021-01-26 04:18

I am trying to display data from JSON array to ListView. But it gives me an exception:

org.json.JSONException: Value [{\"fine_id\":\"51771\",\"st

1条回答
  •  梦毁少年i
    2021-01-26 04:55

    Do the following:

    Change

    JSONObject data = jsonObj.getJSONObject(json); 
    

    to

    JSONArray data = jsonObj.getJSONArray(json);
    

    json is an array, not an object. Thus you are getting an exception.

    Edited:

    for(int i=0; i

    P.S

    [ represents JSON array node
    
    { represents JSON object node
    

    0 讨论(0)
提交回复
热议问题