String imageName = "index_fragmen"+getColor();
final int resId = context.getResources().getIdentifier(imageName, "drawable", context.getPackageName());
if (resId != 0) {
Log.e("mytest", "可以获取到");
holder.btnCoupon.setBackgroundResource(resId);
}

 

 程序猿必读

posted on 2016-12-28 11:10  龙种人  阅读(2537)  评论(0编辑  收藏  举报