我想检查ImageView在xml中附加了哪个图像资源,我能够检查哪个图像资源附加到图像视图但我的要求是如何检查它是否ImageView具有我设置为xml的相同资源,基于我需要执行一些actions.Code总是执行其他部分.以下是我的代码,
if (regProfile.getDrawable() == getResources().getDrawable( R.drawable.ivpic))
{
Toast.makeText(_con, "Image is ivPic", Toast.LENGTH_LONG).show();
// new RegisterAsyntaskNew().execute();
}
else
{
Toast.makeText(_con, "Image isn't ivPic", Toast.LENGTH_LONG).show();
// new RegisterAsyntask().execute();
}
Run Code Online (Sandbox Code Playgroud)