Transform an array of string (which are links) into an imageView in android with json

0

I have a json on a server with links of images and need to convert to imageView, I could only open on the android screen as a string showing the image link.

My json

Mycodethatreceivesjson

StringRequestrequest=newStringRequest(url,newResponse.Listener<String>(){@OverridepublicvoidonResponse(Stringstring){parseJsonData(string);}},newResponse.ErrorListener(){@OverridepublicvoidonErrorResponse(VolleyErrorvolleyError){Toast.makeText(getApplicationContext(),"Some error occurred!!", Toast.LENGTH_SHORT).show();
            dialog.dismiss();
        }
    });

    RequestQueue rQueue = Volley.newRequestQueue(MainActivity.this);
    rQueue.add(request);
}

void parseJsonData(String jsonString) {
    try {
        JSONObject object = new JSONObject(jsonString);
        JSONArray fruitsArray = object.getJSONArray("fruits");
        ArrayList al = new ArrayList();

        for(int i = 0; i < fruitsArray.length(); ++i) {
            al.add(fruitsArray.getString(i));
        }

        ArrayAdapter adapter = new ArrayAdapter(this,android.R.layout.simple_list_item_1, al);
        fruitsList.setAdapter(adapter);
    } catch (JSONException e) {
        e.printStackTrace();
    }

    dialog.dismiss();
}
    
asked by anonymous 21.06.2018 / 01:58

1 answer

0

Thanks Anderson and Leonardo I managed to solve, I found a site with the content that I was looking for I will leave the link to study

link

    
26.06.2018 / 00:41