I am trying to compare two drawables but without success. I did some research, there is even a similar question but did not help.
In my app, I use getCompoundDrawablesWithIntrinsicBounds
to get the ImageView in the right position of a EditText.
Then I need to check which image resource is alocated there.
This small sample should work, shouldn't it? It returns "not equal", though.
Drawable drawable1 = ContextCompat.getDrawable(getApplicationContext(),R.drawable.cor);
Drawable drawable2 = ContextCompat.getDrawable(getApplicationContext(),R.drawable.cor);
if(drawable1 == drawable2){
System.out.println("equal");
}else{
System.out.println("not equal");
}