I'm using Gson and am trying to add a bunch of string values into a JsonArray
like this:
JsonArray jArray = new JsonArray();
jArray.add("value1");
The problem is that the add method only takes a JsonElement
.
I've tried to cast a String into a JsonElement
but that didn't work.
How do I do it using Gson?