Array1 = Array2 set's the arrays to look at the same array, therefore array1 = array2 will always be true. If you change array1, array2 will change as well.
You can use java.util.Arrays with JavaObject to do the comparison:
B4X:
Public Sub EqualsObjArr(A() As Object, A2() As Object) As Boolean
Dim JO As JavaObject
JO.InitializeStatic("java.util.Arrays")
Return JO.RunMethod("equals",Array As Object(A, A2))
End Sub
Array1 = Array2 set's the arrays to look at the same array, therefore array1 = array2 will always be true. If you change array1, array2 will change as well.
You can use java.util.Arrays with JavaObject to do the comparison:
B4X:
Public Sub EqualsObjArr(A() As Object, A2() As Object) As Boolean
Dim JO As JavaObject
JO.InitializeStatic("java.util.Arrays")
Return JO.RunMethod("equals",Array As Object(A, A2))
End Sub
No the function compares the array contents. Probably similar to the way DaOne has implemented it, although I would guess it would be quicker on large arrays rather than testing each element in this way.
I know when I tested the java.util.Arrays copying, there was minimal improvement over doing it in a loop, I think the compiler must be clever enough to use the native libraries in these cases.