public class ExercisesDetailActivity extends AppCompatActivity {
private TextView tv_main_title;
private TextView tv_back;
private RelativeLayout rl_title_bar;
private ListView lv_list;
private String title;
private ExercisesBean bean;
private List<ExercisesDetailBean> detalList;
private ExercisesDetailAdapter adapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_exercises_detail);
//获取从习题界面传递过来的习题数据
bean = (ExercisesBean) getIntent().getSerializableExtra("detalList");
if (bean != null) {
title = bean.getChapterName(); //获取习题所在的章节名称
detalList = bean.getDetalList();//为什么这一段有问题?我的这里的detaList不就是下面的detalList吗?
}
public class ExercisesBean implements Serializable {
private static final long serialVersionUID=1L;
private int id;//章节id
private String chapterName;//章节名称
private int totalNum;//习题总数
private int background;//章节序号背景
private List<ExercisesDetailBean> detalList;//习题详情列表
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getChapterName() {
return chapterName;
}
public void setChapterName(String chapterName) {
this.chapterName = chapterName;
}
public int getTotalNum() {
return totalNum;
}
public void setTotalNum(int totalNum) {
this.totalNum = totalNum;
}
public int getBackground() {
return background;
}
public void setBackground(int backgroud) {
this.background = backgroud;
}
public List<ExercisesDetailBean> getDetalList() {
return detalList;
}
public void setDetalList(List<ExercisesDetailBean> detalList) {
this.detalList = detalList;
}
}
这里为什么获取数据的时候获取不到啊?我