Code example for JsonArray

Methods: toString

0
		return peerGroups;
 
	} 
 
	public void savePeerGroups(List<PeerGroupID> peerGroups) {
		JsonArray json = new JsonArray();
 
		for (int i = 0; i < peerGroups.size(); i++) {
			JsonObject obj = new JsonObject();
			obj.addProperty("id", peerGroups.get(i).toString());
			json.add(obj);
		} 
		prefs.put(TAG_PEERGROUPS, json.toString());
		save(); 
 
	} 
 
	 
 
} 
Experience pair programming with AI  Get Codota for Java