Welcome to my blog, hope you enjoy reading
RSS

Tuesday, 5 March 2013

convert ArrayList to JSONArray


Convert ArrayList to JSONArray

ArrayList<String> list = new ArrayList<String>();
    list.add("abc");
    list.add("xyz");
    JSONArray jsArray = new JSONArray(list);

see api click here


How to add string into JsonArray



 JSONArray list = new JSONArray();
 list.put("abc");
 list.put("xyz");

1 comments: