Blake Gibbs
Blake Gibbs

Reputation: 495

Adding Bitmap a name

When i convert bitmap to string with toString() i get something like that: android.graphics.Bitmap@40da7c08. I want that name to be always the same so i can compare it. Is there any way to do it?

Upvotes: 0

Views: 142

Answers (2)

draksia
draksia

Reputation: 2371

It would be better to extend the bitmap class and add another method to generate a unique identifier that you understand.

Upvotes: 1

midhunhk
midhunhk

Reputation: 5554

This is the default implementation of the toString() method in Java. Its basically the fully classified name of the class, followed by the hexcode of the object.

I would suggest that you do your comparison based on the equals() method or wrap your Bitmap objects inside a class of yours and add a name or id property.

Upvotes: 0

Related Questions