Get Data from ArrayList Model class in android -
i using gson library pasring json,
gson gson = new gson(); reader reader = new inputstreamreader(source); propertymodel[] response = gson.fromjson(reader, propertymodel[].class);
i had set data in araylist like
arraylist<propertymodel[]> model=arraylist<propertymodel[]>(); model.add(response);
now problem not able arraylist propertymodel class data
please suggest me how can value arraylist
thanks in advance
try code work...
string responsestring = jsonarray.tostring(); log.e("jsonarray string --->", "" + responsestring); type listtype = new typetoken<arraylist<modelonevonelistitem>>() { }.gettype(); yourarraylist = new gson().fromjson(responsestring, listtype);
Comments
Post a Comment