Android Question Method Equals

LucaMs

Expert
Licensed User
Longtime User
I have not found a way to use the Equals method.

I know too little Reflection and tried to write this code (it is inserted within a class clsCustomer):
B4X:
Public Sub Equals(Obj As clsEmployee) As Boolean
    Return (GetObjHashCode(Obj) = GetObjHashCode(Me))
End Sub

Private Sub GetObjHashCode(Obj As Object) As Int
    Private r As Reflector
    Return r.RunStaticMethod("java.lang.System", "identityHashCode", Array As Object(Obj), Array As String("java.lang.Object"))
End Sub


Will it be enough?
 
Top