判断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");
posted on 2013-03-07 16:07  wzc0066  阅读(347)  评论(0编辑  收藏  举报