判断ImageView的图片资源ID

比如要判断当前ImageView里面的图片是否为R.id.abc这个图片,可以通过如下方式判定:

if(imageView.getDrawable().getConstantState().equals(getResources().getDrawable(R.id.abc).getConstantState()))
System.out.println("true");
else
System.out.println("false");
原文地址:https://www.cnblogs.com/wzc0066/p/2948270.html