Android: parse JSON response when a key can be a JSON object or a JSON array
问题 I am fetching data from API provided by our Backend team. One of the keys data sometimes contains JSONObject and sometimes it contains JSONArray . I am using GSON to parse the response and it is throwing an exception because of this. I tried the solution given in this thread but it's not working in my case. How to dynamically handle json response array/object using Gson POJO (EntityDetailResponseV2): package com.tf.eros.faythTv.objects.entityDetail; import com.google.gson.Gson; import com