I have this JSON and I'm trying to parse it Java classes using GSON. Here is the JSON
resp = "{"isVisible":true,"image":{"preferenceOrder":["Rose","Lilly","Lotus"]}}";
my parse code for java is this.
ImageOrderResult result = new Gson().fromJson(resp,ImageOrderResult.class);
and here is the class which i have defined
public class ImageOrderResult {
//Used for general Error Tracing
public String status = "";
public String message = "";
public String errorTrace = "";
public class Image{
@SerializedName("preferenceOrder")
public ArrayList<String> flowers= new ArrayList<String>();
}
@SerializedName("isVisible")
public boolean isVisible= false;
}
Here i'm missing out the flowers array part. Parser is not able to fetch the list of values. How do I solve it?