Comparing two drawables in android

Update
https://stackoverflow.com/a/36373569/1835650

getConstantState() works not well

There is another way to compare:

mRememberPwd.getDrawable().getConstantState().equals
            (getResources().getDrawable(R.drawable.login_checked).getConstantState());

mRemeberPwd is an ImageView in this example. If you’re using a TextView, use getBackground().getConstantState instead.

Leave a Comment