0
[{"id":94973,"slug":"la-liga-real-betis-1-1-barcelona-29-januari-2017","type":"post"},{"id":94957,"slug":"fa-chelsea-4-0-brentford-28-januari-2017","type":"post"},{"id":94944,"slug":"serie-a-ac-milan-1-2-napoli-22-januari-2017","type":"post"},{"id":94663,"slug":"boullier-soroti-performa-mclaren-musim-ini","type":"post"},{"id":94660,"slug":"balotelli-tawarkan-diri-ke-sassuolo","type":"post"}]
JSON响应,我想与改造 我已经检查过这并没有什么错,从JSON获取数据,但我recyclerview犯规显示任何数据。我认为我错了,通过对arraylist然后适配器的响应。
我对响应等级
}
,这onbindview在我的适配器类
public void onBindViewHolder(MyAdapter.MyViewHolder holder, int position) {
holder.mTextView.setText(String.valueOf(coba.get(position).getId()));
holder.mDetView.setText(String.valueOf(coba.get(position).getSlug()));
holder.mVerView.setText(String.valueOf(coba.get(position).getType()));
holder.mCardView.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v){
Intent intent = new Intent(v.getContext(),DetailBerita.class);
v.getContext().startActivity(intent);
System.out.println("Clicked");
}
});
}
你可以给最好的教程网站的链接学习改造吗? –
它仍然没有向适配器显示任何数据。但是当我检查循环..似乎回应它好吧.. –
它的工作现在..thanks..i在我的onbindview添加String.valueOf,然后我使用你的解决方案,通过添加data.addAll(responseBody); ,不使用data.clear; –