1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
try {
JSONArray jArray = new JSONArray(result);
for (int i = 0; i < jArray.length(); i++) { //jArray.length()
json_data = jArray.getJSONObject(i);
mapPPPP = new HashMap<String, Object>();
mapPPPP.put("NN", json_data.getString("num_paquet"));
mapPPPP.put("DD", json_data.getString("date_planification"));
mapPPPP.put("LO", json_data.getString("localite"));
listItem.add(mapPPPP);
}
} catch (JSONException e) {
Toast.makeText(getApplicationContext(), "Aucun package dans cette date ", Toast.LENGTH_LONG).show();
Log.i("tagjsonexp", "" + e.toString());
} catch (ParseException e) {
Log.i("tagjsonpars", "" + e.toString());
} |
Partager