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

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -