I want to check which image resource is attached to ImageView
in xml, I am able to check that which image resource is attached to image view but my requirement is to how to check that the ImageView
has the same resource which I have set into xml or not, based on that I need to perform some actions.Code always executes else part. Following is my 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();
}