Hello,
I do not have much knowledge in Json and I have a problem and I did not find an exact solution of it in the community.
I have the following format in the json file:
{
"name" : "ProductName",
"description" : "description",
"alternate": [
{"type": "prodType", "element": "prodElement"}
]
},
What I need and can not do:
Take the 'prodType' value inside the string and store it in a string and do the same with the 'prodElement' value.
My Gson file looks like this:
@SerializedName("name")
public String name;
@SerializedName("description")
public String description;
@SerializedName("alternate")
public List alternate;
I did not declare 'Type' and 'Element' because I do not know if I should and how I would.
I made the getters and setters, but it only returns the entire line:
{"type": "prodType", "element": "prodElement"}
Does anyone know how to proceed?
Thank you!