GetMethod in Reflection Library

Similar threads

B4A Code Snippet Get CRC32 from File
B4A Question Changing Locale of Android
B4A Question String CRC32
B4A Question Help with CRC32 function
B4A Question Custom checksum crc16

keirS

Well-Known Member
Licensed User
Got the following code.

B4X:
Dim Types(1) As String
  Types(0) = "[B"
  'Create an instance of theCRC32 class using reflection ans set it as the target of the Reflector.
  oReflector.Target = oReflector.CreateObject("java.util.zip.CRC32")
  
  'Register the Update method of the CRC32 class [public void update (byte[] buf)]
  'Adds the byte array passed to the data that the checksum is being calculated for
  omUpdate= oReflector.GetMethod("update",Types)
  Types(0) = ""
  
  'Register the get method of the CRC32 class [public long getValue ()]
  'Returns the CRC32 checksum as a long
  omGetValue =  oReflector.GetMethod("getValue",Types)
  
 'Register the reset method of the CRC32 class [public void reset ()]
 'Clears the data that the checksum is being calculated for so a new checksum can be calculated
  omReset = oReflector.GetMethod("reset",Types)
The first call to GetMethod runs fine. The other calls fail with a Class Not Found Exception. How do I register a method with no parameters?
 
Top