0

当我将位图转换为字符串时, toString()我得到类似的东西:android.graphics.Bitmap@40da7c08。我希望该名称始终相同,以便我可以比较它。有什么办法吗?

4

2 回答 2

1

最好扩展位图类并添加另一个方法来生成您理解的唯一标识符。

于 2012-09-18T18:23:52.663 回答
0

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.

于 2012-09-18T18:22:12.820 回答