Kindly asking for help, I am trying to get a JSON response from an API and the response was not null and kinda long because it has a Base64 encoded picture data This is the fragment from the response
and this is the part of the code i use to get the JSON response and convert it to JSONArray
StringRequest reqMasterDataShift = new StringRequest(Request.Method.GET, ActionUrl.LastShift+"/"+siteCode,
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
try{
JSONObject jsonObject = new JSONObject(response);
JSONArray shift = jsonObject.getJSONArray("shift");
JSONArray shiftPhoto = jsonObject.getJSONArray("shift_photo"); // Method threw 'java.lang.StackOverflowError' exception. Cannot evaluate org.json.JSONObject.toString()
Timestamp currentTime = new java.sql.Timestamp(System.currentTimeMillis());
ObjectMapper mapper = new ObjectMapper();
ArrayList<ShiftModel> shiftData = new ArrayList<>();
shiftData = mapper.readValue(shift.toString(), new TypeReference<ArrayList<ShiftModel>>() {});
ArrayList<ShiftPhotoModel> shiftPhotoData = new ArrayList<>();
shiftPhotoData = mapper.readValue(shiftPhoto.toString(), new TypeReference<ArrayList<ShiftPhotoModel>>() {});
.
.
...
I kindly hope for your help or solution for this problem, and i really appreciate for comments or some suggestion, thanks!