I have a problem. I filled the fields of my cardviews with data from a JSON file and displays them in a recyclerview. Now , what i want is to use two differents type of cardview to display data.
Example of JSON
{
{
"id":"3",
"title":"Title1",
"place":"Stade omnisport de lom\u00e9",
"imageUrl":".\/uploads\/thumbs\/20150907133004.jpg",
"Description":"Lorem ipsum dolor erit ex, quis mollis massa sollicitudin eu. Mauris congue auctor placerat",
"codeCity":"1"
},
{
"id":"15",
"title":"Title2",
"place":"centre culturelle arena",
"imageUrl":".\/uploads\/thumbs\/C3.PNG",
"Description":"Lorem ultrices dapibus. Praesent feugiat hendrerit ex, quis mollis massa sollicitudin eu. Mauris congue auctor placerat",
"codeCity":"1"
}
{
"id":"85",
"title":"Title3",
"place":"centrena",
"imageUrl":".\/uploads\/thumbs\/A4.PNG",
"Description":"Lorem ultrices dapibus. Praesent feugiat hendrerit ex, quis mollis massa sollicitudin eu. Mauris congue auctor placerat",
"codeCity":"2"
}
}
I want to use different views depending on the city code. For example, for the codecity "1" I use the view 1 and for codecity 2 I use the view 2. In which part of my code I have to do that and how?