1

one of my customers detected a bug in my application after upgrading his Huawei to emui 12. In the following, I'm checking if the imageView has ic_correct_deactiviated so that I will convert it to ic_correct_activiated, the following always returns false in emui12, here is my code.

 if (checkCircleImageViewRecyclerViewLevelTwo.getDrawable().getConstantState()
                            .equals(mContext.getDrawable(R.drawable.ic_correct_deactivated).getConstantState())) {
                                                 checkCircleImageViewRecyclerViewLevelTwo.setImageResource(R.drawable.ic_correct_activated);
Basil Battikhi
  • 2,638
  • 1
  • 18
  • 34
  • You can try to convert your `Drawable` to Bitmap and use `convertedBitmap1.sameAs(convertedBitmap2)` or check this : https://stackoverflow.com/questions/9125229/comparing-two-drawables-in-android – Mouaad Abdelghafour AITALI Apr 18 '22 at 23:03

0 Answers0