您的位置:首页 > 其它

判断ImageView的图片资源ID

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

if(imageView.getDrawable().getConstantState().equals(getResources().getDrawable(R.id.abc).getConstantState()))
System.out.println("true");
else
System.out.println("false");
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: