view.setBackgroundResource(R.drawable.icon);
view.setBackground(ContextCompat.getDrawable(this, R.drawable.icon));
警告: [deprecation] View中的setBackgroundDrawable(Drawable)已过时
关键词由CSDN通过智能技术生成