I'm having JSON format as below, I'm able to fetch this JSON data into android using retrofit but after fetching I'm not getting how to display it in Horizontal RecyclerView in Vertical RecyclerView as shown in below image, I want AAAAA to be displayed instead of Section1 and name1 instead of item1 and respective image to be displayed. Please help me to write android code for this.
{"result":
{"AAAAA":[{"firm_name":"name1","image_path":"1.jpg"},
{"firm_name":"name2","image_path":"2.jpg"}],
"BBBBB":[{"firm_name":"name1","image_path":"1.jpg"}],
"CCCCC":[{"firm_name":"name1","image_path":"1.jpg"}],
"DDDDD":[{"firm_name":"name1","image_path":"1.jpg"}],
"EEEEE":[{"firm_name":"name1","image_path":"1.jpg"}]
}
}
This is my Json code
Here is my pojo class
package com.example;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class Example {
@SerializedName("result")
@Expose
private Result result;
public Result getResult() {
return result;
}
public void setResult(Result result) {
this.result = result;
}
}
package com.example;
import java.util.List;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class Result {
@SerializedName("AAAAA")
@Expose
private List<AAAAA> aAAAA = null;
@SerializedName("BBBBB")
@Expose
private List<BBBBB> bBBBB = null;
@SerializedName("CCCCC")
@Expose
private List<Object> cCCCC = null;
@SerializedName("DDDDD")
@Expose
private List<Object> dDDDD = null;
@SerializedName("EEEEE")
@Expose
private List<Object> eEEEE = null;
public List<AAAAA> getAAAAA() {
return aAAAA;
}
public void setAAAAA(List<AAAAA> aAAAA) {
this.aAAAA = aAAAA;
}
public List<BBBBB> getBBBBB() {
return bBBBB;
}
public void setBBBBB(List<BBBBB> bBBBB) {
this.bBBBB = bBBBB;
}
public List<Object> getCCCCC() {
return cCCCC;
}
public void setCCCCC(List<Object> cCCCC) {
this.cCCCC = cCCCC;
}
public List<Object> getDDDDD() {
return dDDDD;
}
public void setDDDDD(List<Object> dDDDD) {
this.dDDDD = dDDDD;
}
public List<Object> getEEEEE() {
return eEEEE;
}
public void setEEEEE(List<Object> eEEEE) {
this.eEEEE = eEEEE;
}
}