How to compare two drawables, I am doing like this but not having any success
public void MyClick(View view)
{
Drawable fDraw = view.getBackground();
Drawable sDraw = getResources().getDrawable(R.drawable.twt_hover);
if(fDraw.equals(sDraw))
{
//Not coming
}
}
Update
https://stackoverflow.com/a/36373569/1835650
getConstantState() works not well
There is another way to compare:mRemeberPwdis anImageViewin this example. If you’re using aTextView, usegetBackground().getConstantStateinstead.