Doe het om MiNtimeIn
. te krijgen van First JSONObject en MaXtimeOut
van tweede JSONObject:
String MiNtimeIn,MaXtimeOut;
JSONArray array=new JSONArray(json);
if(array.length()<2){
JSONObject jsonObject = array.getJSONObject(0);
MiNtimeIn = jsonObject.optString(Configs.TAG_IN);
MaXtimeOut=jsonObject.optString(Configs.TAG_OUT);
}else{
// get First Object from JSONArray
JSONObject oneObject = array.getJSONObject(0);
MiNtimeIn = oneObject.optString(Configs.TAG_IN); // get min from first row
// get Second Object from JSONArray
JSONObject twoObject = array.getJSONObject(array.length()-1);
MaXtimeOut = twoObject.optString(Configs.TAG_OUT); // get min from second row
}