Maybe my question is a beginner one i have this JSON , as a response , I post a "id" and the result is like that , as u can see my response began with square brackets [] and i can't change it
[{
"id": "1111",
"nam": "name",
"namk": "surename",
"lygn": [{
"id": "3003",
"mas": "lurem11",
"yeg": "lurem11"
},
{
"id": "5121",
"mas": "lurem",
"yeg": "lurem"
}],
"lisar": [
{
"id": "3",
"sharh": "lurem22",
"amal": "lurem22",
"toz": "1",
"tb": "1"
},
{
"id": "2113",
"sharh": "0",
"amal": "lurem",
"toz",
"tb": "1965/06/11"
}
]
}]
this is my request :
@POST("isargaran")
@Headers({"Content-Type: application/json"})
Call<List<ForAll>> postbyid(@Body ForAll md);
and my model class is :
public class ForAll {
@SerializedName("id")
@Expose
private String id;
@SerializedName("nam")
@Expose
private String nam;
@SerializedName("namk")
@Expose
private String namk;
@SerializedName("namp")
@Expose
private String namp;
@SerializedName("lygn")
@Expose
public List<Ygn> ygn = null;
@SerializedName("lisar")
@Expose
public List<lisar> lisar;
//getter and setter
}
and i have "lisar" and "Ygn" class too , So far there is no problem because I get the Response.body and everything well ( i used all of my getters and i showed then in textview ) but the thing is i wanna show them in a recyclerview , i tried and i could only see index 0 , can't see all of them , i mean i can only see (lygn)
{
"id": "3003",
"mas": "lurem",
"yeg": "lurem"
}
(and first data for "lisar")
and i don't want to share my adapter And make it crowded here , my question is , HOW CAN I SHOW ALL OFF MY "lygn" AND "lisar" IN RECYCLERVIEW(i have a recycler for each) thanks you guys , ples help me
** i think problem is because of my response starts with []