Should I be concerned at this warning, I am passing an Integer to a sub that expects a javaobject.
I thought a javaobject could take any type of variable.
B4X:
...
Log(Integer_toHexString(1,99) << warning on this line "Types do not match. (warning #22)"
...
'++++++++++++++++++++++++
'++ AutoGenerated Code ++
'++++++++++++++++++++++++
' Argument is : int
Sub Integer_toHexString(ob As JavaObject, arg As Int) As String
Return ob.RunMethod("toHexString",Array(arg))
End Sub
I do normally, but I am testing some code that generates the entire sub to execute javaobject.runmethod for any class in the java libraries.
(I picked the hextostring as I know what I should get back, all I had to do was type 'Integer', then selected java.lang.Integer, then selected toHexString(int) and the code was produced for me).
So can I ignore the warning as the code seems to run ok, but wanted to check.
Should I be concerned at this warning, I am passing an Integer to a sub that expects a javaobject.
I thought a javaobject could take any type of variable.
B4X:
...
Log(Integer_toHexString(1,99) << warning on this line "Types do not match. (warning #22)"
...
'++++++++++++++++++++++++
'++ AutoGenerated Code ++
'++++++++++++++++++++++++
' Argument is : int
Sub Integer_toHexString(ob As JavaObject, arg As Int) As String
Return ob.RunMethod("toHexString",Array(arg))
End Sub
Now I remember that something like this exists in .Net too (after all, coincidentally, VB.Net, C#, etc. followed Java); but I don't entered into these "subtleties"