Android get elements from json array -
i'm trying elements json array.
this json response:
{"ids":["635426812801493839","635429094450867472","635433640807558204"]}
this i've tried far:
itemlist = new arraylist<hashmap<string, string>>(); jsonarray = jsonobj.getjsonarray(constants.ids); int arrsize = a.length(); arraylist<string> stringarray = new arraylist<string>(); (int = 0; < arrsize; ++i) { jsonobject obj = a.getjsonobject(i); stringarray.add(obj.tostring()); item = new hashmap<string, string>(); item.put(constants.id, obj.tostring()); itemlist.add(item); } log.e("arr count", "" + stringarray.size());
but i'm getting empty list. wrong code? appreciated. thanks.
the loop should be
for (int = 0; < arrsize; ++i) { stringarray.add(a.getstring(i));
your jsonarray
contains string
Comments
Post a Comment