private void init() {
//加载广告图片
XBanner1.loadImage(new XBanner.XBannerAdapter() {
@Override
public void loadBanner(XBanner banner, Object model, View view, int position) {
JsonBean.ResultBean resultBean = (JsonBean.ResultBean) model;
// JsonData.ResultBean resultBean= (JsonData.ResultBean) model;
Glide.with(MainActivity.this).load(resultBean.getImageUrl()).into((ImageView) view);
}
});
}
JsonBean data1 = new Gson().fromJson(data,JsonBean.class);
List<JsonBean.ResultBean> result = data1.getResult();
XBanner1.setBannerData(result);