How Can I Compare Two Drawables in Android?
Contents

How can I tell if two pictures are the same on Android?

2 Answers

  1. Check that the height matches, if not return false. Then, check if the width matches, and if not, return false. Then check each pixel until you find one that doesn’t match. When you do, return false. …
  2. maybe you convert the images in to byte64 Strings and then compare them.
  3. **OpenCV lib for Android :

20 мар. 2012 г.

How do I know if my Android is drawable?

You are comparing a Drawable with an integer ( R. drawable. ic_favorite_border is an integer). On the other hand, to compare Drawables, you must use the object returned by the getConstantState() method.

Robert Thorne

Robert Thorne

Automotive & Future Transportation Editor

Robert Thorne covers electric vehicle innovations, autonomous driving systems, global mobility trends, and automotive engineering developments.

Share this article
Twitter Facebook Pinterest