Hi I know how to fetch an string from jsonobject, but my question is how to fetch an image from Rest api and display it. The image is stored as profile_image in jsonobject
My code:
try {
JSONObject jsonObject = new JSONObject(response);
JSONObject object = jsonObject.getJSONObject("user");
String attr1 = object.getString("username");
data = "" + attr1;
textView15.setText(data);
if (object.has("profession")) {
String attr2 = object.getString("profession");
data2 = "" + attr2;
textView16.setText(data2);
}
if(object.has("company")){
String attr3 = object.getString("company");
data3 = "" + attr3;
textView38.setText(data3);
}
if(object.has("profile_image")) {
//what has to be done here
}