JSON object in json array in Android -
i want put objects in array , in spinner (caracteristici) response gets information. project stoped when should put them in array.
try { jsonobject jobj = new jsonobject(response); jsonarray caracteristiciarray = jobj.getjsonarray(constants.tag_caracteristici); caracteristici.clear(); (int = 0; < caracteristiciarray.length(); i++) { jsonobject c = caracteristiciarray.getjsonobject(i); caracteristici.add(new caracteristici(c.getstring(constants.tag_caracterizare), c.getstring(constants.tag_statistica)));
response: {"clasa_caracterizare":[{"denumire_caracterizare":"adezivi si lacuri"},{"denumire_caracterizare":"materiale"},{"denumire_caracterizare":"altele"}]}....
you try extract constants.tag_caracterizare , constants.tag_statistica - objects have 1 string element - unless constants.tag_caracterizare equal constants.tag_statistica - fail
Comments
Post a Comment