我的 JSON 格式如下,我可以使用改造将这个 JSON 数据获取到 android 中,但是在获取之后我没有得到如何在 Vertical RecyclerView 的 Horizontal RecyclerView 中显示它,如下图所示,我想要 AAAAA显示而不是 Section1 和 name1 而不是 item1 和要显示的相应图像。请帮我为此编写android代码。
{"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
这是我的 pojo 课
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;
}
}