JSONArray to HashMap

匿名 (未验证) 提交于 2019-12-03 01:47:02

问题:

I've a JSONArray and I need to get the hashmap with the values, because I need to populate a stream, like twitter done. What you suggest to do?

回答1:

HashMap pairs = new HashMap(); for (int i = 0; i 

Something like that.



回答2:

You can use Iterator for getting JsonArrays. or use this way

eg. json

{ ........ ........   "FARE":[   //JSON Array     {     "REG_ID":3,     "PACKAGE_ID":1,     "MODEL_ID":9,     "MIN_HOUR":0     .......     .......     .......     }       ] } 
HashMap mMap= new HashMap(); for (int i = 0; i 

note: For better coding use Iterator



文章来源: JSONArray to HashMap
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!